diff --git a/src/bus/cookies.rs b/src/bus/cookies.rs index d602dcc..ca6f2ba 100644 --- a/src/bus/cookies.rs +++ b/src/bus/cookies.rs @@ -1,13 +1,14 @@ use anyhow::{anyhow, Error, Result}; use rand::Rng; -#[cfg(unix)] -use std::{fs::Permissions, os::unix::prelude::PermissionsExt}; use std::{ + fmt::{self, Display, Formatter}, io, str::FromStr, time::{Duration, SystemTime, UNIX_EPOCH}, }; #[cfg(unix)] +use std::{fs::Permissions, os::unix::prelude::PermissionsExt}; +#[cfg(unix)] use tokio::fs::set_permissions; use tokio::{ fs::{create_dir_all, metadata, remove_file, rename, File, OpenOptions}, @@ -219,9 +220,9 @@ impl FromStr for Cookie { } } -impl ToString for Cookie { - fn to_string(&self) -> String { - format!("{} {} {}", self.id, self.created, self.cookie) +impl Display for Cookie { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + write!(f, "{} {} {}", self.id, self.created, self.cookie) } }