Skip to content

Commit

Permalink
VerificationResult: CustomDebugStringConvertible (#2739)
Browse files Browse the repository at this point in the history
I'm debugging some code and it's harder to follow it when we just print
`VerificationResult(rawValue: 1)`
  • Loading branch information
NachoSoto authored Jun 29, 2023
1 parent 68892f3 commit 4a154fc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Sources/Security/VerificationResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ extension VerificationResult: DefaultValueProvider {

}

extension VerificationResult: CustomDebugStringConvertible {

var debugDescription: String {
let prefix = "\(type(of: self))"

switch self {
case .notRequested: return "\(prefix).notRequested"
case .verified: return "\(prefix).verified"
case .verifiedOnDevice: return "\(prefix).verifiedOnDevice"
case .failed: return "\(prefix).failed"
}
}

}

extension VerificationResult {

/// - Returns: the most restrictive ``VerificationResult`` based on the cached verification and
Expand Down

0 comments on commit 4a154fc

Please sign in to comment.