Skip to content

Commit

Permalink
A little bit of cleanup
Browse files Browse the repository at this point in the history
* remove the default constant since it’s only used in one place now
* Fix a comment typo
  • Loading branch information
chriseplettsonos committed Nov 13, 2023
1 parent 708b84c commit 2c3283e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Sources/SemanticVersion/SemanticVersion+Codable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 }
Expand All @@ -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
Expand Down

0 comments on commit 2c3283e

Please sign in to comment.