diff options
author | Lars Wirzenius <liw@liw.fi> | 2024-03-15 05:45:50 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2024-03-15 05:45:50 +0000 |
commit | d19841b087996784f1437a743a6916a443f4911b (patch) | |
tree | 93dff6e69da88b75b6b3bdb74a6eee22cef08280 /src/builder.rs | |
parent | ed1c8990707b451580e45aea0169b9a82fe739f2 (diff) | |
parent | f29c6e680baefec5289d4fb75d7bf96118b62d84 (diff) | |
download | obnam-benchmark-d19841b087996784f1437a743a6916a443f4911b.tar.gz |
fixes
See merge request obnam/obnam-benchmark!16
Diffstat (limited to 'src/builder.rs')
-rw-r--r-- | src/builder.rs | 4 |
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) } |