Skip to content

Commit 6d4fda6

Browse files
committed
Fixes for Swift 5.0 & Linux
1 parent 9eed21e commit 6d4fda6

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

Sources/SemanticVersion/SemanticVersion.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extension SemanticVersion: LosslessStringConvertible {
3939

4040

4141
extension SemanticVersion: Comparable {
42-
public static func < (lhs: Self, rhs: Self) -> Bool {
42+
public static func < (lhs: SemanticVersion, rhs: SemanticVersion) -> Bool {
4343
if lhs.major != rhs.major { return lhs.major < rhs.major }
4444
if lhs.minor != rhs.minor { return lhs.minor < rhs.minor }
4545
if lhs.patch != rhs.patch { return lhs.patch < rhs.patch }
@@ -57,12 +57,12 @@ extension SemanticVersion: Comparable {
5757

5858

5959
extension SemanticVersion {
60-
public var isStable: Bool { preRelease.isEmpty && build.isEmpty }
61-
public var isPreRelease: Bool { !isStable }
62-
public var isMajorRelease: Bool { isStable && (major > 0 && minor == 0 && patch == 0) }
63-
public var isMinorRelease: Bool { isStable && (minor > 0 && patch == 0) }
64-
public var isPatchRelease: Bool { isStable && patch > 0 }
65-
public var isInitialRelease: Bool { self == .init(0, 0, 0) }
60+
public var isStable: Bool { return preRelease.isEmpty && build.isEmpty }
61+
public var isPreRelease: Bool { return !isStable }
62+
public var isMajorRelease: Bool { return isStable && (major > 0 && minor == 0 && patch == 0) }
63+
public var isMinorRelease: Bool { return isStable && (minor > 0 && patch == 0) }
64+
public var isPatchRelease: Bool { return isStable && patch > 0 }
65+
public var isInitialRelease: Bool { return self == .init(0, 0, 0) }
6666
}
6767

6868

Tests/LinuxMain.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//
2+
// File.swift
3+
//
4+
//
5+
// Created by Sven A. Schmidt on 01/09/2020.
6+
//
7+
8+
import Foundation

0 commit comments

Comments
 (0)