diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-04-21 08:20:43 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-04-21 09:24:01 +0300 |
commit | afc842c9025e33f2e25716d80ecac07117766457 (patch) | |
tree | c0c563d80cb5d190e5afbd09704055db7ad4a1c1 /src/rust.rs | |
parent | 50258196ee8832ca8d9f02e73babb431248ed025 (diff) | |
download | bumper-rs-afc842c9025e33f2e25716d80ecac07117766457.tar.gz |
refactor: make logging and messages more consistent
Also, report the Debian package version correctly, not just the
upstream part.
Diffstat (limited to 'src/rust.rs')
-rw-r--r-- | src/rust.rs | 9 |
1 files changed, 7 insertions, 2 deletions
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<Self, BumperError> { 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<String, BumperError> { 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> { |