From d42034a9b0ae0b127eb9d9d54321b3466cb182d2 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 12 Aug 2023 13:44:41 +0200 Subject: Run ‘cargo fmt’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index af958b0..7ef3bc3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -118,7 +118,7 @@ fn work() -> Result<(), io::Error> { if flags.verbose { eprintln!("created directory ‘{}’", dir.path().display()); } - + let ps = srcs .iter() .zip(dsts) @@ -155,7 +155,13 @@ fn work() -> Result<(), io::Error> { let cache_base = env::var("XDG_CACHE_HOME").unwrap_or_else(|_| { err!("XDG_CACHE_HOME variable must be set"); }); - cache_dir = [Path::new(cache_base.as_str()), Path::new("mmv"), Path::new(pid.as_str())].iter().collect::(); + cache_dir = [ + Path::new(cache_base.as_str()), + Path::new("mmv"), + Path::new(pid.as_str()), + ] + .iter() + .collect::(); fs::create_dir_all(&cache_dir)?; if flags.verbose { @@ -193,7 +199,7 @@ fn work() -> Result<(), io::Error> { fn backup_srcs<'a, I>(flags: &Flags, cwd: &PathBuf, xs: I) -> Result<(), io::Error> where - I: Iterator + I: Iterator, { for x in xs { let data = require!(fs::metadata(x)); @@ -214,7 +220,12 @@ where let rel_x = require!(x.strip_prefix("/")); fs::copy(x, rel_x)?; if flags.verbose { - eprintln!("copied ‘{}’ -> ‘{}/{}’", disp(x), disp(cwd), rel_x.display()); + eprintln!( + "copied ‘{}’ -> ‘{}/{}’", + disp(x), + disp(cwd), + rel_x.display() + ); } } } @@ -316,7 +327,11 @@ fn run_multi( src.to_owned() } )?; - ci.write_all(if flags.nul && !flags.encode { &[b'\0'] } else { &[b'\n'] })?; + ci.write_all(if flags.nul && !flags.encode { + &[b'\0'] + } else { + &[b'\n'] + })?; } } -- cgit v1.2.3