From 2c3283e91d3ab2ece6462f261df63badb580dfb8 Mon Sep 17 00:00:00 2001 From: Chris Eplett Date: Fri, 3 Nov 2023 09:04:56 -0400 Subject: [PATCH] A little bit of cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove the default constant since it’s only used in one place now * Fix a comment typo --- Sources/SemanticVersion/SemanticVersion+Codable.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Sources/SemanticVersion/SemanticVersion+Codable.swift b/Sources/SemanticVersion/SemanticVersion+Codable.swift index f3c3168..4223156 100644 --- a/Sources/SemanticVersion/SemanticVersion+Codable.swift +++ b/Sources/SemanticVersion/SemanticVersion+Codable.swift @@ -20,8 +20,6 @@ public enum SemanticVersionStrategy { /// Encode/decode the `SemanticVersion` to/fromfrom a string that conforms to the /// semantic version 2.0 specification at https://semver.org. case semverString - - internal static let `default`: Self = .semverString } extension JSONEncoder { @@ -33,7 +31,7 @@ extension JSONEncoder { } extension JSONDecoder { - /// The strategy to use in decoding semantic versions. Defaults to `.succint`. + /// The strategy to use in decoding semantic versions. Defaults to `.semverString`. public var semanticVersionDecodingStrategy: SemanticVersionStrategy { get { userInfo.semanticDecodingStrategy } set { userInfo.semanticDecodingStrategy = newValue } @@ -43,7 +41,7 @@ extension JSONDecoder { private extension [CodingUserInfoKey: Any] { var semanticDecodingStrategy: SemanticVersionStrategy { get { - (self[.semanticVersionStrategy] as? SemanticVersionStrategy) ?? .default + (self[.semanticVersionStrategy] as? SemanticVersionStrategy) ?? .semverString } set { self[.semanticVersionStrategy] = newValue