mirror of
https://git.proxmox.com/git/proxmox
synced 2025-04-29 13:39:05 +00:00
tfa, auth-api: simplify and restyle Display implementation
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
4836cb5334
commit
5c7b1ab4ab
@ -1,7 +1,7 @@
|
|||||||
//! Generate and verify Authentication tickets
|
//! Generate and verify Authentication tickets
|
||||||
|
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::fmt::Display;
|
use std::fmt;
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
use anyhow::{bail, format_err, Error};
|
use anyhow::{bail, format_err, Error};
|
||||||
@ -19,9 +19,9 @@ const TICKET_ASCIISET: &AsciiSet = &percent_encoding::CONTROLS.add(b':');
|
|||||||
/// with no data.
|
/// with no data.
|
||||||
pub struct Empty;
|
pub struct Empty;
|
||||||
|
|
||||||
impl Display for Empty {
|
impl fmt::Display for Empty {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(f, "")
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//! Webauthn configuration and challenge data.
|
//! Webauthn configuration and challenge data.
|
||||||
|
|
||||||
use std::fmt::Display;
|
use std::fmt;
|
||||||
|
|
||||||
use anyhow::{format_err, Error};
|
use anyhow::{format_err, Error};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@ -44,9 +44,9 @@ impl From<OriginUrl> for String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for OriginUrl {
|
impl fmt::Display for OriginUrl {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(f, "{}", self.0.origin().ascii_serialization())
|
f.write_str(&self.0.origin().ascii_serialization())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user