diff --git a/src/cargo.rs b/src/cargo.rs index 64449ae..ef38cf8 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -123,7 +123,8 @@ fn flags(config: Option<&Config>, target: &str, tool: &str) -> Result Filesystem { - Filesystem { path: path, quiet: quiet } + Filesystem { + path: path, + quiet: quiet, + } } pub fn join(&self, other: T) -> Filesystem @@ -111,7 +114,9 @@ impl Filesystem { })?; } State::Shared => { - acquire(msg, &path, self.quiet, &|| try_lock_shared(&f), &|| lock_shared(&f))?; + acquire(msg, &path, self.quiet, &|| try_lock_shared(&f), &|| { + lock_shared(&f) + })?; } } @@ -183,11 +188,7 @@ fn acquire( } if !quiet { - eprintln!( - "{:>12} waiting for file lock on {}", - "Blocking", - msg - ) + eprintln!("{:>12} waiting for file lock on {}", "Blocking", msg) } lock_block() diff --git a/src/rustc.rs b/src/rustc.rs index 887a311..207052d 100644 --- a/src/rustc.rs +++ b/src/rustc.rs @@ -73,8 +73,10 @@ impl Sysroot { }); } - Err(anyhow!("`rust-src` component not found. Run `rustup component add \ - rust-src`.")) + Err(anyhow!( + "`rust-src` component not found. Run `rustup component add \ + rust-src`." + )) } } diff --git a/src/sysroot.rs b/src/sysroot.rs index 5d1d940..312c39e 100644 --- a/src/sysroot.rs +++ b/src/sysroot.rs @@ -93,12 +93,14 @@ fn build_crate( td_lockfile.display() ) })?; - let mut perms = fs::metadata(&td_lockfile).with_context(|| { - format!( - "failed to retrieve permissions for `{}`", - td_lockfile.display() - ) - })?.permissions(); + let mut perms = fs::metadata(&td_lockfile) + .with_context(|| { + format!( + "failed to retrieve permissions for `{}`", + td_lockfile.display() + ) + })? + .permissions(); perms.set_readonly(false); fs::set_permissions(&td_lockfile, perms).with_context(|| { format!( @@ -177,7 +179,7 @@ fn build_liballoc( authors = ["The Rust Project Developers"] name = "alloc" version = "0.0.0" -edition = "2018" +edition = "2021" [dependencies.compiler_builtins] version = "0.1.0" @@ -192,10 +194,7 @@ version = "0.1.0" } stoml.push_str("[dependencies.core]\n"); - stoml.push_str(&format!( - "path = '{}'\n", - src.path().join("core").display() - )); + stoml.push_str(&format!("path = '{}'\n", src.path().join("core").display())); if config.panic_immediate_abort { stoml.push_str("features = ['panic_immediate_abort']\n"); diff --git a/src/util.rs b/src/util.rs index baedda0..7dfb8f2 100644 --- a/src/util.rs +++ b/src/util.rs @@ -3,7 +3,7 @@ use std::fs::File; use std::io::{Read, Write}; use std::path::Path; -use anyhow::{anyhow, Result, Context}; +use anyhow::{anyhow, Context, Result}; use toml::Value; use walkdir::WalkDir;