tfa, auth-api: simplify and restyle Display implementation

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2025-03-06 15:20:33 +01:00
parent 4836cb5334
commit 5c7b1ab4ab
2 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,7 @@
//! Generate and verify Authentication tickets
use std::borrow::Cow;
use std::fmt::Display;
use std::fmt;
use std::marker::PhantomData;
use anyhow::{bail, format_err, Error};
@ -19,9 +19,9 @@ const TICKET_ASCIISET: &AsciiSet = &percent_encoding::CONTROLS.add(b':');
/// with no data.
pub struct Empty;
impl Display for Empty {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "")
impl fmt::Display for Empty {
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
Ok(())
}
}

View File

@ -1,6 +1,6 @@
//! Webauthn configuration and challenge data.
use std::fmt::Display;
use std::fmt;
use anyhow::{format_err, Error};
use serde::{Deserialize, Serialize};
@ -44,9 +44,9 @@ impl From<OriginUrl> for String {
}
}
impl Display for OriginUrl {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0.origin().ascii_serialization())
impl fmt::Display for OriginUrl {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.0.origin().ascii_serialization())
}
}