if $c:expr { Some($r:expr) } else { None }
=>> $c.then(|| $r)
This commit is contained in:
parent
af3c8b2726
commit
8751fa1a9a
54 changed files with 159 additions and 281 deletions
|
@ -217,7 +217,7 @@ pub fn get_or_default_sysroot() -> Result<PathBuf, String> {
|
|||
// Look for the target rustlib directory in the suspected sysroot.
|
||||
let mut rustlib_path = rustc_target::target_rustlib_path(&p, "dummy");
|
||||
rustlib_path.pop(); // pop off the dummy target.
|
||||
if rustlib_path.exists() { Some(p) } else { None }
|
||||
rustlib_path.exists().then(|| p)
|
||||
}
|
||||
None => None,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue