From afc842c9025e33f2e25716d80ecac07117766457 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 21 Apr 2021 08:20:43 +0300 Subject: refactor: make logging and messages more consistent Also, report the Debian package version correctly, not just the upstream part. --- src/rust.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/rust.rs') diff --git a/src/rust.rs b/src/rust.rs index 10dc1a1..0ffe8c0 100644 --- a/src/rust.rs +++ b/src/rust.rs @@ -13,6 +13,11 @@ pub struct Rust { impl Rust { pub fn new(dirname: &Path) -> Result { let cargo_toml = dirname.join("Cargo.toml"); + debug!( + "does {} exist? {}", + cargo_toml.display(), + cargo_toml.exists() + ); if cargo_toml.exists() { return Ok(Self { dirname: dirname.to_path_buf(), @@ -22,7 +27,7 @@ impl Rust { Err(BumperError::UnknownProjectKind(dirname.to_path_buf())) } - pub fn set_version(&mut self, version: &str) -> Result<(), BumperError> { + pub fn set_version(&mut self, version: &str) -> Result { debug!("parsing Cargo.toml from {}", self.dirname.display()); // debug!("Cargo.toml:\n{:#?}", self.cargo_toml); self.cargo_toml.set_version(version)?; @@ -40,7 +45,7 @@ impl Rust { dirname.display(), version ); - Ok(()) + Ok(version.to_string()) } fn update_cargo_lock(&self) -> Result<(), BumperError> { -- cgit v1.2.1