diff --git a/src/changelog/mod.rs b/src/changelog/mod.rs index e7d5d8d..3e14b81 100644 --- a/src/changelog/mod.rs +++ b/src/changelog/mod.rs @@ -28,7 +28,7 @@ impl Changelog { let out = cmd.output()?; // FIXME: this does not catch fancy colors, those are from the shell as it seems? I don't // get it. - let buf = String::from_utf8(out.stdout).map_err(|err| ChangelogError::GitUTF8Error(err))?; + let buf = String::from_utf8(out.stdout).map_err(ChangelogError::GitUTF8Error)?; if !out.status.success() { // TODO: get the stderr for error reporting // TODO: Make the error more understandable for the user @@ -43,14 +43,14 @@ impl Changelog { let mut cmd = Command::new("git"); cmd.arg("describe").arg("--tags").arg("--abbrev=0"); let out = cmd.output()?; - let buf = String::from_utf8(out.stdout).map_err(|err| ChangelogError::GitUTF8Error(err))?; + let buf = String::from_utf8(out.stdout).map_err(ChangelogError::GitUTF8Error)?; if !out.status.success() { // TODO: get the stderr for error reporting // TODO: Make the error more understandable for the user return Err(ChangelogError::GitBadStatus(out.status, buf).into()); } - let buf = buf.replace("\n", ""); - return Ok(buf); + let buf = buf.replace('\n', ""); + Ok(buf) } } diff --git a/src/config/cli.rs b/src/config/cli.rs index 5751c65..8a81077 100644 --- a/src/config/cli.rs +++ b/src/config/cli.rs @@ -95,6 +95,6 @@ impl Cli { // less verbose version Logger::init_mini(Some(ll)).expect("could not initialize Logger"); } - return cli; + cli } } diff --git a/src/config/mod.rs b/src/config/mod.rs index 90b08a9..48be007 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -147,7 +147,7 @@ impl Debug for Config { write!( f, "{}", - format!( + format_args!( "Config {{yaml: {:?}, repo_path: {:?}}}", self.yaml, self.path ) diff --git a/src/main.rs b/src/main.rs index aff9d4f..20512d5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,8 +14,7 @@ async fn main() -> Result<()> { match cli.command { Commands::Changelog { .. } => { - println!("{}", Changelog::build(&cfg)?.to_string()); - // Ok(()) + println!("{}", Changelog::build(&cfg)?); } Commands::Release { .. } => { todo!() @@ -24,7 +23,5 @@ async fn main() -> Result<()> { todo!() } }; - - println!("foo"); Ok(()) }