automatic cargo CI changes

This commit is contained in:
PlexSheep 2024-02-16 15:43:33 +00:00 committed by github-actions[bot]
parent 02c51d6e4a
commit db14cb7a8f
3 changed files with 6 additions and 6 deletions

View File

@ -28,7 +28,7 @@ impl Changelog {
let out = cmd.output()?; let out = cmd.output()?;
// FIXME: this does not catch fancy colors, those are from the shell as it seems? I don't // FIXME: this does not catch fancy colors, those are from the shell as it seems? I don't
// get it. // 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() { if !out.status.success() {
// TODO: get the stderr for error reporting // TODO: get the stderr for error reporting
// TODO: Make the error more understandable for the user // TODO: Make the error more understandable for the user
@ -43,14 +43,14 @@ impl Changelog {
let mut cmd = Command::new("git"); let mut cmd = Command::new("git");
cmd.arg("describe").arg("--tags").arg("--abbrev=0"); cmd.arg("describe").arg("--tags").arg("--abbrev=0");
let out = cmd.output()?; 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() { if !out.status.success() {
// TODO: get the stderr for error reporting // TODO: get the stderr for error reporting
// TODO: Make the error more understandable for the user // TODO: Make the error more understandable for the user
return Err(ChangelogError::GitBadStatus(out.status, buf).into()); return Err(ChangelogError::GitBadStatus(out.status, buf).into());
} }
let buf = buf.replace("\n", ""); let buf = buf.replace('\n', "");
return Ok(buf); Ok(buf)
} }
} }

View File

@ -95,6 +95,6 @@ impl Cli {
// less verbose version // less verbose version
Logger::init_mini(Some(ll)).expect("could not initialize Logger"); Logger::init_mini(Some(ll)).expect("could not initialize Logger");
} }
return cli; cli
} }
} }

View File

@ -13,7 +13,7 @@ fn main() -> Result<()> {
match cli.command { match cli.command {
Commands::Changelog { .. } => { Commands::Changelog { .. } => {
println!("{}", Changelog::build(&cfg)?.to_string()); println!("{}", Changelog::build(&cfg)?);
Ok(()) Ok(())
} }
Commands::Release { .. } => { Commands::Release { .. } => {