@@ -65,10 +65,7 @@ fn list_targets(mut args: impl Iterator<Item=String>) -> impl Iterator<Item=carg
6565 {
6666 metadata
6767 } else {
68- let _ = std:: io:: stderr ( ) . write_fmt ( format_args ! (
69- "error: Could not obtain cargo metadata."
70- ) ) ;
71- std:: process:: exit ( 101 ) ;
68+ show_error ( format ! ( "error: Could not obtain cargo metadata." ) ) ;
7269 } ;
7370
7471 let manifest_path = manifest_path_arg. map ( |arg| {
@@ -106,14 +103,11 @@ fn ask(question: &str) {
106103 print ! ( "{} [Y/n] " , question) ;
107104 io:: stdout ( ) . flush ( ) . unwrap ( ) ;
108105 io:: stdin ( ) . read_line ( & mut buf) . unwrap ( ) ;
109- let answer = match buf. trim ( ) . to_lowercase ( ) . as_ref ( ) {
110- "" | "y" | "yes" => true ,
111- "n" | "no" => false ,
106+ match buf. trim ( ) . to_lowercase ( ) . as_ref ( ) {
107+ "" | "y" | "yes" => { } , // proceed
108+ "n" | "no" => show_error ( format ! ( "Aborting as per your request" ) ) ,
112109 a => show_error ( format ! ( "I do not understand `{}`" , a) )
113110 } ;
114- if !answer {
115- show_error ( format ! ( "Aborting as per your request" ) )
116- }
117111}
118112
119113/// Perform the setup requires to make `cargo miri` work: Getting a custom-built libstd. Then sets MIRI_SYSROOT.
@@ -152,7 +146,7 @@ fn setup(ask_user: bool) {
152146 }
153147
154148 // Next, we need our own libstd. We will do this work in ~/.miri.
155- let dir = dirs :: home_dir ( ) . unwrap ( ) . join ( ".miri" ) ;
149+ let dir = directories :: UserDirs :: new ( ) . unwrap ( ) . home_dir ( ) . join ( ".miri" ) ;
156150 if !dir. exists ( ) {
157151 fs:: create_dir ( & dir) . unwrap ( ) ;
158152 }
0 commit comments