mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-04-01 01:25:32 +00:00
exclude message from string trait
This commit is contained in:
parent
5358e43697
commit
8df7af44b5
5 changed files with 56 additions and 29 deletions
|
|
@ -55,10 +55,11 @@ impl std::fmt::Display for Certificate {
|
|||
f,
|
||||
"{}",
|
||||
match self {
|
||||
Self::Required { message } => message.as_deref().unwrap_or(REQUIRED.1),
|
||||
Self::NotAuthorized { message } => message.as_deref().unwrap_or(NOT_AUTHORIZED.1),
|
||||
Self::NotValid { message } => message.as_deref().unwrap_or(NOT_VALID.1),
|
||||
Self::Required { .. } => REQUIRED,
|
||||
Self::NotAuthorized { .. } => NOT_AUTHORIZED,
|
||||
Self::NotValid { .. } => NOT_VALID,
|
||||
}
|
||||
.1
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -104,6 +105,7 @@ fn test_from_str() {
|
|||
|
||||
assert_eq!(required.message(), Some("Message"));
|
||||
assert_eq!(required.to_code(), REQUIRED.0);
|
||||
assert_eq!(required.to_string(), REQUIRED.1);
|
||||
|
||||
let required = Certificate::from_str("60\r\n").unwrap();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue