Skip to content

Commit 6e5ec8a

Browse files
committed
dist: use more concise API in helper function
1 parent e461c6d commit 6e5ec8a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/dist/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,7 @@ impl FromStr for ParsedToolchainDesc {
333333

334334
fn non_empty_string(s: Option<Match<'_>>) -> Option<String> {
335335
let s = s?.as_str();
336-
if s.is_empty() {
337-
None
338-
} else {
339-
Some(s.to_owned())
340-
}
336+
(!s.is_empty()).then(|| s.to_owned())
341337
}
342338

343339
Ok(Self {

0 commit comments

Comments
 (0)