]> git.proxmox.com Git - rustc.git/blobdiff - src/bootstrap/setup.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / src / bootstrap / setup.rs
index 2d4484c562c40db77f9a715800d9fc31de0f9690..725147767dbd1eac034694216549253bdb892dfb 100644 (file)
@@ -89,7 +89,7 @@ pub fn setup(src_path: &Path, profile: Profile) {
         std::process::exit(1);
     }
 
-    let path = cfg_file.unwrap_or("config.toml".into());
+    let path = cfg_file.unwrap_or_else(|| "config.toml".into());
     let settings = format!(
         "# Includes one of the default files in src/bootstrap/defaults\n\
     profile = \"{}\"\n\
@@ -156,7 +156,7 @@ pub fn interactive_path() -> io::Result<Profile> {
         io::stdout().flush()?;
         let mut input = String::new();
         io::stdin().read_line(&mut input)?;
-        if input == "" {
+        if input.is_empty() {
             eprintln!("EOF on stdin, when expecting answer to question.  Giving up.");
             std::process::exit(1);
         }