util: optimize opaque string formatting
This commit is contained in:
parent
e6c3c9c1ed
commit
8d6aaf79a7
3 changed files with 30 additions and 6 deletions
|
|
@ -1,5 +1,6 @@
|
|||
use {
|
||||
crate::utils::opaque::{opaque, Opaque, OpaqueError},
|
||||
crate::utils::opaque::{opaque, Opaque, OpaqueError, OPAQUE_LEN},
|
||||
arrayvec::ArrayString,
|
||||
std::{
|
||||
fmt::{Display, Formatter},
|
||||
str::FromStr,
|
||||
|
|
@ -13,6 +14,12 @@ pub fn activation_token() -> ActivationToken {
|
|||
ActivationToken(opaque())
|
||||
}
|
||||
|
||||
impl ActivationToken {
|
||||
pub fn to_string(self) -> ArrayString<OPAQUE_LEN> {
|
||||
self.0.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for ActivationToken {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
self.0.fmt(f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue