summaryrefslogtreecommitdiff
path: root/src/builder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/builder.rs')
-rw-r--r--src/builder.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/builder.rs b/src/builder.rs
index ac414c7..f2aadf2 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -92,7 +92,7 @@ impl ObnamBuilder {
}
let v = String::from_utf8_lossy(&output.stdout);
- let v = v.strip_suffix('\n').or(Some(&v)).unwrap().to_string();
+ let v = v.strip_suffix('\n').unwrap_or(&v).to_string();
Ok(v)
}
@@ -140,7 +140,7 @@ fn git_create_branch(dir: &Path, branch: &str, commit: &str) -> Result<(), Obnam
fn git_resolve(dir: &Path, commit: &str) -> Result<String, ObnamBuilderError> {
run("git", &["rev-parse", commit], dir)
- .map(|s| s.strip_suffix('\n').or(Some("")).unwrap().to_string())
+ .map(|s| s.strip_suffix('\n').unwrap_or("").to_string())
.map_err(ObnamBuilderError::Git)
}