From e8ecb3ae76f8e1cf5c53de8db7e805e99f44d20b Mon Sep 17 00:00:00 2001 From: Michal S Date: Mon, 20 Feb 2023 21:20:34 +0000 Subject: [PATCH] recover: recover Malachite v3.0.0 --- src/build.rs | 8 ++++---- src/config.rs | 2 +- src/generate.rs | 8 ++++---- src/info.rs | 6 +++--- src/main.rs | 5 ++--- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/build.rs b/src/build.rs index d118b3a..d350abe 100644 --- a/src/build.rs +++ b/src/build.rs @@ -74,7 +74,7 @@ impl Build { async fn podman_build(&self) -> AppResult<()> { let uid = uid(); - let podman = Podman::new(format!("unix:///var/run/user/{}/podman/podman.sock", uid))?; + let podman = Podman::new(format!("unix:///var/run/user/{uid}/podman/podman.sock"))?; let image = self.kind.image().unwrap(); let buildfile = fs::read_to_string(".mlc/Buildfile")?; @@ -114,11 +114,11 @@ impl Build { println!("{}", chunk.stream); let _ = log_file.write(chunk.stream.as_bytes())?; } - Err(e) => eprintln!("{}", e), + Err(e) => eprintln!("{e}"), } } } - Err(e) => eprintln!("{}", e), + Err(e) => eprintln!("{e}"), }; podman @@ -177,7 +177,7 @@ impl Build { &CopyOptions::new(), )?; } - Err(e) => eprintln!("{}", e), + Err(e) => eprintln!("{e}"), } } diff --git a/src/config.rs b/src/config.rs index b03914f..eae91ee 100644 --- a/src/config.rs +++ b/src/config.rs @@ -166,7 +166,7 @@ impl Config { std::fs::write( ".mlc/mlc.lock", - format!("[lockfile]\nversion = '{}'\n\n[remote]\n", LOCKFILE_VERSION), + format!("[lockfile]\nversion = '{LOCKFILE_VERSION}'\n\n[remote]\n"), )?; std::fs::write(".mlc/conf.d/.gitkeep", "\n")?; std::fs::write(".mlc/store/.gitkeep", "\n")?; diff --git a/src/generate.rs b/src/generate.rs index d41be01..e362241 100644 --- a/src/generate.rs +++ b/src/generate.rs @@ -139,7 +139,7 @@ impl PacmanRepository { pub async fn podman_generate(&self) -> AppResult<()> { let uid = uid(); - let podman = Podman::new(format!("unix:///run/user/{}/podman/podman.sock", uid))?; + let podman = Podman::new(format!("unix:///run/user/{uid}/podman/podman.sock"))?; let image = self.kind.image().unwrap(); let generatefile = fs::read_to_string(".mlc/Generatefile")?; @@ -171,12 +171,12 @@ impl PacmanRepository { Ok(mut generate_stream) => { while let Some(chunk) = generate_stream.next().await { match chunk { - Ok(chunk) => println!("{:?}", chunk), - Err(e) => eprintln!("{}", e), + Ok(chunk) => println!("{chunk:?}"), + Err(e) => eprintln!("{e}"), } } } - Err(e) => eprintln!("{}", e), + Err(e) => eprintln!("{e}"), }; podman diff --git a/src/info.rs b/src/info.rs index 2d51c91..bc8de3e 100644 --- a/src/info.rs +++ b/src/info.rs @@ -23,9 +23,9 @@ pub enum GitStatus { impl GitStatus { fn color(&self) -> String { match self { - Self::Clean => format!("{}{}", BOLD, CLEAN), - Self::Dirty => format!("{}{}", BOLD, DIRTY), - Self::Unknown => format!("{}{}", BOLD, UNKNOWN), + Self::Clean => format!("{BOLD}{CLEAN}"), + Self::Dirty => format!("{BOLD}{DIRTY}"), + Self::Unknown => format!("{BOLD}{UNKNOWN}"), } } } diff --git a/src/main.rs b/src/main.rs index 21c643b..205b87a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -227,10 +227,9 @@ fn cmd_info() -> AppResult<()> { let mut table = tabled::Table::new(overview); table.with(tabled::Style::rounded()); - println!("{}", table); + println!("{table}"); println!( - " {}Key:{} {}Clean {}Unknown {}Dirty{}", - BOLD, RESET, CLEAN, UNKNOWN, DIRTY, RESET + " {BOLD}Key:{RESET} {CLEAN}Clean {UNKNOWN}Unknown {DIRTY}Dirty{RESET}" ); Ok(())