Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed Dec 17, 2022
1 parent fcb753e commit b0dbf46
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub(crate) async fn is_flatpak() -> bool {

pub(crate) async fn is_snap() -> bool {
let pid = std::process::id();
let path = format!("/proc/{}/cgroup", pid);
let path = format!("/proc/{pid}/cgroup");
let mut file = match File::open(path).await {
Ok(file) => file,
Err(_) => return false,
Expand Down
2 changes: 1 addition & 1 deletion src/portal/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl Keyring {
.collect();

let mut tmp_path = parent.to_path_buf();
tmp_path.push(format!(".tmpkeyring{}", rnd));
tmp_path.push(format!(".tmpkeyring{rnd}"));

if !parent.exists() {
#[cfg(feature = "tracing")]
Expand Down
5 changes: 2 additions & 3 deletions src/portal/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::FileHeaderMismatch(e) => {
write!(f, "File header doesn't match FILE_HEADER {:#?}", e)
write!(f, "File header doesn't match FILE_HEADER {e:#?}")
}
Error::VersionMismatch(e) => write!(
f,
"Version doesn't match MAJOR_VERSION OR MICRO_VERSION {:#?}",
e
"Version doesn't match MAJOR_VERSION OR MICRO_VERSION {e:#?}",
),
Error::NoData => write!(f, "No data behind header and version bytes"),
Error::NoParentDir(e) => write!(f, "No Parent Directory {e}"),
Expand Down
6 changes: 3 additions & 3 deletions src/portal/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl Default for RetrieveOptions {
.map(char::from)
.collect();
Self {
handle_token: format!("oo7_{}", token),
handle_token: format!("oo7_{token}"),
}
}
}
Expand Down Expand Up @@ -90,8 +90,8 @@ impl<'a> SecretProxy<'a> {
let unique_name = cnx.unique_name().unwrap();
let unique_identifier = unique_name.trim_start_matches(':').replace('.', "_");
let path = ObjectPath::try_from(format!(
"/org/freedesktop/portal/desktop/request/{}/{}",
unique_identifier, options.handle_token
"/org/freedesktop/portal/desktop/request/{unique_identifier}/{}",
options.handle_token
))
.unwrap();

Expand Down

0 comments on commit b0dbf46

Please sign in to comment.