Skip to content

Commit c692fd6

Browse files
committed
Make Urgency sortable
1 parent c57a331 commit c692fd6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Sources/SwiftMETAR/Remarks/Remark.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,8 @@ public enum Remark: Codable, Equatable, Sendable {
486486
}
487487

488488
/// How critical a remark is to aviation safety.
489-
public enum Urgency: Codable, Equatable, Sendable {
490-
489+
public enum Urgency: Int, Codable, Equatable, Sendable, Comparable {
490+
491491
/// Remark could not be parsed.
492492
case unknown
493493

@@ -499,6 +499,10 @@ public enum Remark: Codable, Equatable, Sendable {
499499

500500
/// Remark is almost certainly critical to aviation safety.
501501
case urgent
502+
503+
public static func < (lhs: Remark.Urgency, rhs: Remark.Urgency) -> Bool {
504+
lhs.rawValue < rhs.rawValue
505+
}
502506
}
503507
}
504508

0 commit comments

Comments
 (0)