This commit is contained in:
2023-07-05 14:25:51 +02:00
parent 363770066d
commit 52a7682a55
11 changed files with 226 additions and 407 deletions

View File

@ -227,6 +227,17 @@ impl From<VerificationToken<TcStateNone>> for TcStateToken {
}
}
impl TryFrom<TcStateToken> for VerificationToken<TcStateAccepted> {
type Error = ();
fn try_from(value: TcStateToken) -> Result<Self, Self::Error> {
if let TcStateToken::Accepted(token) = value {
Ok(token)
} else {
return Err(());
}
}
}
impl From<VerificationToken<TcStateAccepted>> for TcStateToken {
fn from(t: VerificationToken<TcStateAccepted>) -> Self {
TcStateToken::Accepted(t)