@@ -65,10 +65,7 @@ fn list_targets(mut args: impl Iterator<Item=String>) -> impl Iterator<Item=carg
65
65
{
66
66
metadata
67
67
} 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." ) ) ;
72
69
} ;
73
70
74
71
let manifest_path = manifest_path_arg. map ( |arg| {
@@ -106,14 +103,11 @@ fn ask(question: &str) {
106
103
print ! ( "{} [Y/n] " , question) ;
107
104
io:: stdout ( ) . flush ( ) . unwrap ( ) ;
108
105
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" ) ) ,
112
109
a => show_error ( format ! ( "I do not understand `{}`" , a) )
113
110
} ;
114
- if !answer {
115
- show_error ( format ! ( "Aborting as per your request" ) )
116
- }
117
111
}
118
112
119
113
/// 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) {
152
146
}
153
147
154
148
// 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" ) ;
156
150
if !dir. exists ( ) {
157
151
fs:: create_dir ( & dir) . unwrap ( ) ;
158
152
}
0 commit comments