From 6d6e5561529f7b43c33faa36a57138ab6d0ea230 Mon Sep 17 00:00:00 2001 From: Rob Amos Date: Sun, 14 Jul 2024 23:20:55 +1000 Subject: [PATCH] Accept code suggestions and reformat --- Sources/Vexil/Decorator.swift | 49 ------------------- .../Snapshots/MutableFlagContainer.swift | 23 ++++----- .../Vexil/Snapshots/Snapshot+Extensions.swift | 23 ++++----- Sources/Vexil/Visitors/FlagDescriber.swift | 32 ++++++++++++ Sources/VexilMacros/FlagContainerMacro.swift | 5 +- Sources/VexilMacros/FlagGroupMacro.swift | 7 +-- Sources/VexilMacros/FlagMacro.swift | 2 +- .../Utilities/PatternBindingSyntax.swift | 16 +++--- .../CaseIterableFlagControl.swift | 42 ++++++++-------- .../OptionalCaseIterableFlagControl.swift | 38 +++++++------- Sources/Vexillographer/FlagGroupView.swift | 22 ++++----- Sources/Vexillographer/FlagSectionView.swift | 16 +++--- Sources/Vexillographer/FlagView.swift | 44 ++++++++--------- Sources/Vexillographer/Vexillographer.swift | 8 +-- 14 files changed, 152 insertions(+), 175 deletions(-) delete mode 100644 Sources/Vexil/Decorator.swift create mode 100644 Sources/Vexil/Visitors/FlagDescriber.swift diff --git a/Sources/Vexil/Decorator.swift b/Sources/Vexil/Decorator.swift deleted file mode 100644 index c32bf759..00000000 --- a/Sources/Vexil/Decorator.swift +++ /dev/null @@ -1,49 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Vexil open source project -// -// Copyright (c) 2024 Unsigned Apps and the open source contributors. -// Licensed under the MIT license -// -// See LICENSE for license information -// -// SPDX-License-Identifier: MIT -// -//===----------------------------------------------------------------------===// - -import Foundation - -/// A type-erasing protocol used so that `FlagPole`s and `Snapshot`s can pass -/// the necessary information so generic `Flag`s and `FlagGroup`s can "decorate" themselves -/// with a reference to where to lookup flag values and how to calculate their key. -/// -// internal protocol Decorated { -// func decorate(lookup: FlagLookup, label: String, codingPath: [String], config: VexilConfiguration) -// } -// -// internal extension Sequence { -// -// typealias DecoratedChild = (label: String, value: Decorated) -// -// var decorated: [DecoratedChild] { -// compactMap { child -> DecoratedChild? in -// guard -// let label = child.label, -// let value = child.value as? Decorated -// else { -// return nil -// } -// -// return (label, value) -// } -// -// // all of our decorated items are property wrappers, -// // so they'll start with an underscore -// .map { child -> DecoratedChild in -// ( -// label: child.label.hasPrefix("_") ? String(child.label.dropFirst()) : child.label, -// value: child.value -// ) -// } -// } -// } diff --git a/Sources/Vexil/Snapshots/MutableFlagContainer.swift b/Sources/Vexil/Snapshots/MutableFlagContainer.swift index 4777eca6..7b81359d 100644 --- a/Sources/Vexil/Snapshots/MutableFlagContainer.swift +++ b/Sources/Vexil/Snapshots/MutableFlagContainer.swift @@ -86,16 +86,13 @@ extension MutableFlagContainer: Hashable where Container: Hashable { // MARK: - Debugging -// extension MutableFlagContainer: CustomDebugStringConvertible { -// public var debugDescription: String { -// "\(String(describing: Group.self))(" -// + Mirror(reflecting: group).children -// .map { _, value -> String in -// (value as? CustomDebugStringConvertible)?.debugDescription -// ?? (value as? CustomStringConvertible)?.description -// ?? String(describing: value) -// } -// .joined(separator: ", ") -// + ")" -// } -// } +extension MutableFlagContainer: CustomDebugStringConvertible { + public var debugDescription: String { + let describer = FlagDescriber() + container.walk(visitor: describer) + return "\(String(describing: Container.self))(" + + describer.descriptions.joined(separator: ", ") + + ")" + } +} + diff --git a/Sources/Vexil/Snapshots/Snapshot+Extensions.swift b/Sources/Vexil/Snapshots/Snapshot+Extensions.swift index b397ef50..694312e3 100644 --- a/Sources/Vexil/Snapshots/Snapshot+Extensions.swift +++ b/Sources/Vexil/Snapshots/Snapshot+Extensions.swift @@ -25,16 +25,13 @@ extension Snapshot: Hashable where RootGroup: Hashable { } } -// extension Snapshot: CustomDebugStringConvertible { -// public var debugDescription: String { -// "Snapshot<\(String(describing: RootGroup.self)), \(values.count) overrides>(" -// + Mirror(reflecting: rootGroup).children -// .map { _, value -> String in -// (value as? CustomDebugStringConvertible)?.debugDescription -// ?? (value as? CustomStringConvertible)?.description -// ?? String(describing: value) -// } -// .joined(separator: "; ") -// + ")" -// } -// } +extension Snapshot: CustomDebugStringConvertible { + public var debugDescription: String { + let describer = FlagDescriber() + rootGroup.walk(visitor: describer) + let count = values.withLock { $0.count } + return "Snapshot<\(String(describing: RootGroup.self)), \(count) overrides>(" + + describer.descriptions.joined(separator: "; ") + + ")" + } +} diff --git a/Sources/Vexil/Visitors/FlagDescriber.swift b/Sources/Vexil/Visitors/FlagDescriber.swift new file mode 100644 index 00000000..ea82ff53 --- /dev/null +++ b/Sources/Vexil/Visitors/FlagDescriber.swift @@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Vexil open source project +// +// Copyright (c) 2024 Unsigned Apps and the open source contributors. +// Licensed under the MIT license +// +// See LICENSE for license information +// +// SPDX-License-Identifier: MIT +// +//===----------------------------------------------------------------------===// + +final class FlagDescriber: FlagVisitor { + + var descriptions = [String]() + + func visitFlag( + keyPath: FlagKeyPath, + value: () -> Value?, + defaultValue: Value, + wigwag: () -> FlagWigwag + ) where Value: FlagValue { + let value = value() + let description = (value as? CustomDebugStringConvertible)?.debugDescription + ?? (value as? CustomStringConvertible)?.description + ?? String(describing: value) + descriptions.append("\(keyPath.key)=\(description)") + } + +} + diff --git a/Sources/VexilMacros/FlagContainerMacro.swift b/Sources/VexilMacros/FlagContainerMacro.swift index 3daed1db..a6053895 100644 --- a/Sources/VexilMacros/FlagContainerMacro.swift +++ b/Sources/VexilMacros/FlagContainerMacro.swift @@ -189,11 +189,8 @@ private extension DeclModifierListSyntax { private extension TypeSyntax { var identifier: String? { for token in tokens(viewMode: .all) { - switch token.tokenKind { - case let .identifier(identifier): + if case let .identifier(identifier) = token.tokenKind { return identifier - default: - break } } return nil diff --git a/Sources/VexilMacros/FlagGroupMacro.swift b/Sources/VexilMacros/FlagGroupMacro.swift index ac9d554b..617e9f6e 100644 --- a/Sources/VexilMacros/FlagGroupMacro.swift +++ b/Sources/VexilMacros/FlagGroupMacro.swift @@ -165,9 +165,10 @@ private extension FlagGroupMacro { let stringLiteral = functionCall.arguments.first?.expression.as(StringLiteralExprSyntax.self), let string = stringLiteral.segments.first?.as(StringSegmentSyntax.self) { - switch memberAccess.declName.baseName.text { - case "customKey": self = .customKey(string.content.text) - default: return nil + if case "customKey" = memberAccess.declName.baseName.text { + self = .customKey(string.content.text) + } else { + return nil } } else { diff --git a/Sources/VexilMacros/FlagMacro.swift b/Sources/VexilMacros/FlagMacro.swift index 8e1ad7af..24b45b73 100644 --- a/Sources/VexilMacros/FlagMacro.swift +++ b/Sources/VexilMacros/FlagMacro.swift @@ -104,7 +104,7 @@ private extension AttributeSyntax.Arguments { } // Support for the single description property overload, ie @Flag("description") - if case .argumentList(let list) = self, list.count == 1, let argument = list.first, argument.label == nil { + if case let .argumentList(list) = self, list.count == 1, let argument = list.first, argument.label == nil { return argument } diff --git a/Sources/VexilMacros/Utilities/PatternBindingSyntax.swift b/Sources/VexilMacros/Utilities/PatternBindingSyntax.swift index aad1902f..9121863a 100644 --- a/Sources/VexilMacros/Utilities/PatternBindingSyntax.swift +++ b/Sources/VexilMacros/Utilities/PatternBindingSyntax.swift @@ -34,15 +34,17 @@ extension PatternBindingSyntax { } else if let function = initializer.value.as(FunctionCallExprSyntax.self) { if let identifier = function.calledExpression.as(DeclReferenceExprSyntax.self) { return TypeSyntax(IdentifierTypeSyntax(name: identifier.baseName)) - } else if let memberAccess = function.calledExpression.as(MemberAccessExprSyntax.self) { - if let identifier = memberAccess.base?.as(DeclReferenceExprSyntax.self) { - return TypeSyntax(IdentifierTypeSyntax(name: identifier.baseName)) - } - } - } else if let memberAccess = initializer.value.as(MemberAccessExprSyntax.self) { - if let identifier = memberAccess.base?.as(DeclReferenceExprSyntax.self) { + } else if + let memberAccess = function.calledExpression.as(MemberAccessExprSyntax.self), + let identifier = memberAccess.base?.as(DeclReferenceExprSyntax.self) + { return TypeSyntax(IdentifierTypeSyntax(name: identifier.baseName)) } + } else if + let memberAccess = initializer.value.as(MemberAccessExprSyntax.self), + let identifier = memberAccess.base?.as(DeclReferenceExprSyntax.self) + { + return TypeSyntax(IdentifierTypeSyntax(name: identifier.baseName)) } } diff --git a/Sources/Vexillographer/Flag Value Controls/CaseIterableFlagControl.swift b/Sources/Vexillographer/Flag Value Controls/CaseIterableFlagControl.swift index ac5e00b3..93da15eb 100644 --- a/Sources/Vexillographer/Flag Value Controls/CaseIterableFlagControl.swift +++ b/Sources/Vexillographer/Flag Value Controls/CaseIterableFlagControl.swift @@ -2,7 +2,7 @@ // // This source file is part of the Vexil open source project // -// Copyright (c) 2023 Unsigned Apps and the open source contributors. +// Copyright (c) 2024 Unsigned Apps and the open source contributors. // Licensed under the MIT license // // See LICENSE for license information @@ -38,9 +38,9 @@ struct CaseIterableFlagControl: View where Value: FlagValue, Value: CaseI var content: some View { HStack { - Text(self.label).font(.headline) + Text(label).font(.headline) Spacer() - FlagDisplayValueView(value: self.value) + FlagDisplayValueView(value: value) } } @@ -48,38 +48,38 @@ struct CaseIterableFlagControl: View where Value: FlagValue, Value: CaseI var body: some View { HStack { - if self.isEditable { - NavigationLink(destination: self.selector) { - self.content + if isEditable { + NavigationLink(destination: selector) { + content } } else { - self.content + content } - DetailButton(hasChanges: self.hasChanges, showDetail: self.$showDetail) + DetailButton(hasChanges: hasChanges, showDetail: $showDetail) } } var selector: some View { - SelectorList(value: self.$value) - .navigationBarTitle(Text(self.label), displayMode: .inline) + SelectorList(value: $value) + .navigationBarTitle(Text(label), displayMode: .inline) } #elseif os(macOS) var body: some View { Group { - if self.isEditable { - self.picker + if isEditable { + picker } else { - self.content + content } } } var picker: some View { let picker = Picker( - selection: self.$value, - label: Text(self.label), + selection: $value, + label: Text(label), content: { ForEach(Value.allCases, id: \.self) { value in FlagDisplayValueView(value: value) @@ -114,7 +114,7 @@ struct CaseIterableFlagControl: View where Value: FlagValue, Value: CaseI Button( action: { self.value = value - self.presentationMode.wrappedValue.dismiss() + presentationMode.wrappedValue.dismiss() }, label: { HStack { @@ -123,7 +123,7 @@ struct CaseIterableFlagControl: View where Value: FlagValue, Value: CaseI Spacer() if value == self.value { - self.checkmark + checkmark } } } @@ -135,13 +135,13 @@ struct CaseIterableFlagControl: View where Value: FlagValue, Value: CaseI #if os(macOS) var checkmark: some View { - return Text("✓") + Text("✓") } #else var checkmark: some View { - return Image(systemName: "checkmark") + Image(systemName: "checkmark") } #endif @@ -160,8 +160,8 @@ extension UnfurledFlag: CaseIterableEditableFlag where Value: FlagValue, Value: CaseIterable, Value.AllCases: RandomAccessCollection, Value: RawRepresentable, Value.RawValue: FlagValue, Value: Hashable { - func control(label: String, manager: FlagValueManager, showDetail: Binding) -> AnyView where RootGroup: FlagContainer { - return CaseIterableFlagControl( + func control(label: String, manager: FlagValueManager, showDetail: Binding) -> AnyView { + CaseIterableFlagControl( label: label, value: Binding( key: flag.key, diff --git a/Sources/Vexillographer/Flag Value Controls/OptionalCaseIterableFlagControl.swift b/Sources/Vexillographer/Flag Value Controls/OptionalCaseIterableFlagControl.swift index 1a11c743..11b36246 100644 --- a/Sources/Vexillographer/Flag Value Controls/OptionalCaseIterableFlagControl.swift +++ b/Sources/Vexillographer/Flag Value Controls/OptionalCaseIterableFlagControl.swift @@ -2,7 +2,7 @@ // // This source file is part of the Vexil open source project // -// Copyright (c) 2023 Unsigned Apps and the open source contributors. +// Copyright (c) 2024 Unsigned Apps and the open source contributors. // Licensed under the MIT license // // See LICENSE for license information @@ -41,36 +41,36 @@ struct OptionalCaseIterableFlagControl: View var content: some View { HStack { - Text(self.label).font(.headline) + Text(label).font(.headline) Spacer() - FlagDisplayValueView(value: self.value.wrapped) + FlagDisplayValueView(value: value.wrapped) } } var body: some View { HStack { - if self.isEditable { - NavigationLink(destination: self.selector) { - self.content + if isEditable { + NavigationLink(destination: selector) { + content } } else { - self.content + content } - DetailButton(hasChanges: self.hasChanges, showDetail: self.$showDetail) + DetailButton(hasChanges: hasChanges, showDetail: $showDetail) } } #if os(iOS) var selector: some View { - SelectorList(value: self.$value) - .navigationBarTitle(Text(self.label), displayMode: .inline) + SelectorList(value: $value) + .navigationBarTitle(Text(label), displayMode: .inline) } #else var selector: some View { - SelectorList(value: self.$value) + SelectorList(value: $value) } #endif @@ -87,7 +87,7 @@ struct OptionalCaseIterableFlagControl: View Section { Button( action: { - self.valueSelected(nil) + valueSelected(nil) }, label: { HStack { @@ -95,8 +95,8 @@ struct OptionalCaseIterableFlagControl: View .foregroundColor(.primary) Spacer() - if self.value.wrapped == nil { - self.checkmark + if value.wrapped == nil { + checkmark } } } @@ -106,7 +106,7 @@ struct OptionalCaseIterableFlagControl: View ForEach(Value.WrappedFlagValue.allCases, id: \.self) { value in Button( action: { - self.valueSelected(value) + valueSelected(value) }, label: { HStack { @@ -115,7 +115,7 @@ struct OptionalCaseIterableFlagControl: View Spacer() if value == self.value.wrapped { - self.checkmark + checkmark } } } @@ -127,13 +127,13 @@ struct OptionalCaseIterableFlagControl: View #if os(macOS) var checkmark: some View { - return Text("✓") + Text("✓") } #else var checkmark: some View { - return Image(systemName: "checkmark") + Image(systemName: "checkmark") } #endif @@ -157,7 +157,7 @@ extension UnfurledFlag: OptionalCaseIterableEditableFlag Value.WrappedFlagValue.AllCases: RandomAccessCollection, Value.WrappedFlagValue: RawRepresentable, Value.WrappedFlagValue.RawValue: FlagValue, Value.WrappedFlagValue: Hashable { - func control(label: String, manager: FlagValueManager, showDetail: Binding) -> AnyView where RootGroup: FlagContainer { + func control(label: String, manager: FlagValueManager, showDetail: Binding) -> AnyView { let key = info.key return OptionalCaseIterableFlagControl( diff --git a/Sources/Vexillographer/FlagGroupView.swift b/Sources/Vexillographer/FlagGroupView.swift index b804e468..680df665 100644 --- a/Sources/Vexillographer/FlagGroupView.swift +++ b/Sources/Vexillographer/FlagGroupView.swift @@ -2,7 +2,7 @@ // // This source file is part of the Vexil open source project // -// Copyright (c) 2023 Unsigned Apps and the open source contributors. +// Copyright (c) 2024 Unsigned Apps and the open source contributors. // Licensed under the MIT license // // See LICENSE for license information @@ -41,10 +41,10 @@ struct UnfurledFlagGroupView: View where Group: FlagContainer, Root var body: some View { Form { Section { - self.description + description } .padding([.top, .bottom], 4) - self.flags + flags } } @@ -53,7 +53,7 @@ struct UnfurledFlagGroupView: View where Group: FlagContainer, Root var body: some View { ScrollView { VStack(alignment: .leading) { - self.description + description .padding(.bottom, 8) Divider() } @@ -62,7 +62,7 @@ struct UnfurledFlagGroupView: View where Group: FlagContainer, Root Form { Section { // Filter out all links. They won't work on the mac flag group view. - ForEach(self.group.allItems().filter { $0.isLink == false }, id: \.id) { item in + ForEach(group.allItems().filter { $0.isLink == false }, id: \.id) { item in UnfurledFlagItemView(item: item) } } @@ -70,16 +70,16 @@ struct UnfurledFlagGroupView: View where Group: FlagContainer, Root .padding([.leading, .trailing, .bottom], 30) .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .topLeading) } - .navigationTitle(self.group.info.name) + .navigationTitle(group.info.name) } #else var body: some View { Form { - self.description + description Section { - self.flags + flags } } } @@ -89,15 +89,15 @@ struct UnfurledFlagGroupView: View where Group: FlagContainer, Root var description: some View { VStack(alignment: .leading, spacing: 6) { Text("Description").font(.headline) - Text(self.group.info.description) + Text(group.info.description) } .contextMenu { - CopyButton(action: self.group.info.description.copyToPasteboard) + CopyButton(action: group.info.description.copyToPasteboard) } } var flags: some View { - ForEach(self.group.allItems(), id: \.id) { item in + ForEach(group.allItems(), id: \.id) { item in UnfurledFlagItemView(item: item) } } diff --git a/Sources/Vexillographer/FlagSectionView.swift b/Sources/Vexillographer/FlagSectionView.swift index 7b8b815f..2f18dc97 100644 --- a/Sources/Vexillographer/FlagSectionView.swift +++ b/Sources/Vexillographer/FlagSectionView.swift @@ -2,7 +2,7 @@ // // This source file is part of the Vexil open source project // -// Copyright (c) 2023 Unsigned Apps and the open source contributors. +// Copyright (c) 2024 Unsigned Apps and the open source contributors. // Licensed under the MIT license // // See LICENSE for license information @@ -40,12 +40,12 @@ struct UnfurledFlagSectionView: View where Group: FlagContainer, Ro var body: some View { GroupBox( - label: Text(self.group.info.name), + label: Text(group.info.name), content: { VStack(alignment: .leading) { - Text(self.group.info.description) + Text(group.info.description) Divider() - self.content + content }.padding(4) } ) @@ -56,10 +56,10 @@ struct UnfurledFlagSectionView: View where Group: FlagContainer, Ro var body: some View { Section( - header: Text(self.group.info.name), - footer: Text(self.group.info.description), + header: Text(group.info.name), + footer: Text(group.info.description), content: { - self.content + content } ) } @@ -67,7 +67,7 @@ struct UnfurledFlagSectionView: View where Group: FlagContainer, Ro #endif private var content: some View { - ForEach(self.group.allItems(), id: \.id) { item in + ForEach(group.allItems(), id: \.id) { item in UnfurledFlagItemView(item: item) } } diff --git a/Sources/Vexillographer/FlagView.swift b/Sources/Vexillographer/FlagView.swift index 254e6852..be838ef7 100644 --- a/Sources/Vexillographer/FlagView.swift +++ b/Sources/Vexillographer/FlagView.swift @@ -2,7 +2,7 @@ // // This source file is part of the Vexil open source project // -// Copyright (c) 2023 Unsigned Apps and the open source contributors. +// Copyright (c) 2024 Unsigned Apps and the open source contributors. // Licensed under the MIT license // // See LICENSE for license information @@ -40,37 +40,37 @@ struct UnfurledFlagView: View where Value: FlagValue, RootGrou // MARK: - View Body var body: some View { - self.content + content .contextMenu { - Button("Show Details") { self.showDetail = true } + Button("Show Details") { showDetail = true } } .sheet( - isPresented: self.$showDetail, + isPresented: $showDetail, content: { - self.detailView + detailView } ) } var content: some View { - if let flag = self.flag as? BooleanEditableFlag { - return flag.control(label: self.flag.info.name, manager: self.manager, showDetail: self.$showDetail) + if let flag = flag as? BooleanEditableFlag { + return flag.control(label: self.flag.info.name, manager: manager, showDetail: $showDetail) - } else if let flag = self.flag as? OptionalBooleanEditableFlag { - return flag.control(label: self.flag.info.name, manager: self.manager, showDetail: self.$showDetail) + } else if let flag = flag as? OptionalBooleanEditableFlag { + return flag.control(label: self.flag.info.name, manager: manager, showDetail: $showDetail) - } else if let flag = self.flag as? CaseIterableEditableFlag { - return flag.control(label: self.flag.info.name, manager: self.manager, showDetail: self.$showDetail) + } else if let flag = flag as? CaseIterableEditableFlag { + return flag.control(label: self.flag.info.name, manager: manager, showDetail: $showDetail) - } else if let flag = self.flag as? OptionalCaseIterableEditableFlag { - return flag.control(label: self.flag.info.name, manager: self.manager, showDetail: self.$showDetail) + } else if let flag = flag as? OptionalCaseIterableEditableFlag { + return flag.control(label: self.flag.info.name, manager: manager, showDetail: $showDetail) - } else if let flag = self.flag as? StringEditableFlag { - return flag.control(label: self.flag.info.name, manager: self.manager, showDetail: self.$showDetail) + } else if let flag = flag as? StringEditableFlag { + return flag.control(label: self.flag.info.name, manager: manager, showDetail: $showDetail) - } else if let flag = self.flag as? OptionalStringEditableFlag { - return flag.control(label: self.flag.info.name, manager: self.manager, showDetail: self.$showDetail) + } else if let flag = flag as? OptionalStringEditableFlag { + return flag.control(label: self.flag.info.name, manager: manager, showDetail: $showDetail) } return EmptyView().eraseToAnyView() @@ -80,8 +80,8 @@ struct UnfurledFlagView: View where Value: FlagValue, RootGrou var detailView: some View { NavigationView { - FlagDetailView(flag: self.flag, manager: self.manager) - .navigationBarItems(trailing: self.detailDoneButton) + FlagDetailView(flag: flag, manager: manager) + .navigationBarItems(trailing: detailDoneButton) } } @@ -89,10 +89,10 @@ struct UnfurledFlagView: View where Value: FlagValue, RootGrou var detailView: some View { VStack { - FlagDetailView(flag: self.flag, manager: self.manager) + FlagDetailView(flag: flag, manager: manager) HStack { Spacer() - self.detailDoneButton + detailDoneButton } } .padding() @@ -102,7 +102,7 @@ struct UnfurledFlagView: View where Value: FlagValue, RootGrou var detailDoneButton: some View { Button("Close") { - self.showDetail = false + showDetail = false } } diff --git a/Sources/Vexillographer/Vexillographer.swift b/Sources/Vexillographer/Vexillographer.swift index 04e5c69c..16b5d86d 100644 --- a/Sources/Vexillographer/Vexillographer.swift +++ b/Sources/Vexillographer/Vexillographer.swift @@ -2,7 +2,7 @@ // // This source file is part of the Vexil open source project // -// Copyright (c) 2023 Unsigned Apps and the open source contributors. +// Copyright (c) 2024 Unsigned Apps and the open source contributors. // Licensed under the MIT license // // See LICENSE for license information @@ -43,7 +43,7 @@ public struct Vexillographer: View where RootGroup: FlagContainer { // MARK: - Body public var body: some View { - List(self.manager.allItems(), id: \.id, children: \.childLinks) { item in + List(manager.allItems(), id: \.id, children: \.childLinks) { item in UnfurledFlagItemView(item: item) } .listStyle(SidebarListStyle()) @@ -82,10 +82,10 @@ public struct Vexillographer: View where RootGroup: FlagContainer { } public var body: some View { - ForEach(self.manager.allItems(), id: \.id) { item in + ForEach(manager.allItems(), id: \.id) { item in UnfurledFlagItemView(item: item) } - .environmentObject(self.manager) + .environmentObject(manager) } }