Skip to content

Commit 38190f0

Browse files
authored
Merge pull request #287 from nekrich/master
Deprecate NoError enum
2 parents 908184a + 0286184 commit 38190f0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Result/NoError.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33
/// This can be used to describe `Result`s where failures will never
44
/// be generated. For example, `Result<Int, NoError>` describes a result that
55
/// contains an `Int`eger and is guaranteed never to be a `failure`.
6+
#if swift(>=5.0)
7+
@available(*, deprecated, message: "Use `Swift.Never` instead", renamed: "Never")
68
public enum NoError: Swift.Error, Equatable {
79
public static func ==(lhs: NoError, rhs: NoError) -> Bool {
810
return true
911
}
1012
}
13+
#else
14+
public enum NoError: Swift.Error, Equatable {
15+
public static func ==(lhs: NoError, rhs: NoError) -> Bool {
16+
return true
17+
}
18+
}
19+
#endif

0 commit comments

Comments
 (0)