Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: resolve isolation warnings related to EnvironmentKey #388

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ extension EnvironmentValues {
}

private struct BaseURLKey: EnvironmentKey {
static var defaultValue: URL? = nil
static var defaultValue: URL? { nil }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno what your taste is for indentation - lemme know.

}

private struct ImageBaseURLKey: EnvironmentKey {
static var defaultValue: URL? = nil
static var defaultValue: URL? { nil }
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ extension EnvironmentValues {
}

private struct CodeSyntaxHighlighterKey: EnvironmentKey {
static let defaultValue: CodeSyntaxHighlighter = .plainText
static var defaultValue: CodeSyntaxHighlighter { .plainText }
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ extension EnvironmentValues {
}

private struct ImageProviderKey: EnvironmentKey {
static let defaultValue: AnyImageProvider = .init(.default)
static var defaultValue: AnyImageProvider { .init(.default) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ extension EnvironmentValues {
}

private struct InlineImageProviderKey: EnvironmentKey {
static let defaultValue: InlineImageProvider = .default
static var defaultValue: InlineImageProvider { .default }
}
4 changes: 2 additions & 2 deletions Sources/MarkdownUI/Views/Environment/Environment+List.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ extension EnvironmentValues {
}

private struct ListLevelKey: EnvironmentKey {
static var defaultValue = 0
static var defaultValue: Int { 0 }
}

private struct TightSpacingEnabledKey: EnvironmentKey {
static var defaultValue = false
static var defaultValue: Bool { false }
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ extension EnvironmentValues {
}

private struct SoftBreakModeKey: EnvironmentKey {
static let defaultValue: SoftBreak.Mode = .space
static var defaultValue: SoftBreak.Mode { .space }
}
4 changes: 2 additions & 2 deletions Sources/MarkdownUI/Views/Environment/Environment+Table.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ extension EnvironmentValues {
}

private struct TableBorderStyleKey: EnvironmentKey {
static let defaultValue = TableBorderStyle(color: .secondary)
static var defaultValue: TableBorderStyle { TableBorderStyle(color: .secondary) }
}

private struct TableBackgroundStyleKey: EnvironmentKey {
static let defaultValue = TableBackgroundStyle.clear
static var defaultValue: TableBackgroundStyle { TableBackgroundStyle.clear }
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ extension EnvironmentValues {
}

private struct TextStyleKey: EnvironmentKey {
static let defaultValue: TextStyle = FontProperties()
static var defaultValue: TextStyle { FontProperties() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ extension EnvironmentValues {
}

private struct ThemeKey: EnvironmentKey {
static let defaultValue: Theme = .basic
static var defaultValue: Theme { .basic }
}