Skip to content

Commit 2c3283e

Browse files
A little bit of cleanup
* remove the default constant since it’s only used in one place now * Fix a comment typo
1 parent 708b84c commit 2c3283e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Sources/SemanticVersion/SemanticVersion+Codable.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ public enum SemanticVersionStrategy {
2020
/// Encode/decode the `SemanticVersion` to/fromfrom a string that conforms to the
2121
/// semantic version 2.0 specification at https://semver.org.
2222
case semverString
23-
24-
internal static let `default`: Self = .semverString
2523
}
2624

2725
extension JSONEncoder {
@@ -33,7 +31,7 @@ extension JSONEncoder {
3331
}
3432

3533
extension JSONDecoder {
36-
/// The strategy to use in decoding semantic versions. Defaults to `.succint`.
34+
/// The strategy to use in decoding semantic versions. Defaults to `.semverString`.
3735
public var semanticVersionDecodingStrategy: SemanticVersionStrategy {
3836
get { userInfo.semanticDecodingStrategy }
3937
set { userInfo.semanticDecodingStrategy = newValue }
@@ -43,7 +41,7 @@ extension JSONDecoder {
4341
private extension [CodingUserInfoKey: Any] {
4442
var semanticDecodingStrategy: SemanticVersionStrategy {
4543
get {
46-
(self[.semanticVersionStrategy] as? SemanticVersionStrategy) ?? .default
44+
(self[.semanticVersionStrategy] as? SemanticVersionStrategy) ?? .semverString
4745
}
4846
set {
4947
self[.semanticVersionStrategy] = newValue

0 commit comments

Comments
 (0)