Skip to content

Commit e1ab9db

Browse files
committed
Fix return_and_then lint issues
1 parent baf75ac commit e1ab9db

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

build.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ fn git_revision_hash() -> Option<String> {
3131
let result = process::Command::new("git")
3232
.args(["rev-parse", "--short=10", "HEAD"])
3333
.output();
34-
result.ok().and_then(|output| {
35-
let v = String::from(String::from_utf8_lossy(&output.stdout).trim());
36-
if v.is_empty() { None } else { Some(v) }
37-
})
34+
let output = result.ok()?;
35+
let v = String::from(String::from_utf8_lossy(&output.stdout).trim());
36+
if v.is_empty() { None } else { Some(v) }
3837
}

0 commit comments

Comments
 (0)