@@ -143,7 +143,7 @@ fn run_git(args: &[~str], env: Option<~[(~str, ~str)]>, cwd: &Path, err_msg: &st
143143 let rslt = prog. finish_with_output ( ) ;
144144 if !rslt. status . success ( ) {
145145 fail ! ( "{} [git returned {:?}, output = {}, error = {}]" , err_msg,
146- rslt. status, str :: from_utf8( rslt. output) , str :: from_utf8( rslt. error) ) ;
146+ rslt. status, str :: from_utf8( rslt. output) . unwrap ( ) , str :: from_utf8( rslt. error) . unwrap ( ) ) ;
147147 }
148148}
149149
@@ -279,13 +279,13 @@ fn command_line_test_with_env(args: &[~str], cwd: &Path, env: Option<~[(~str, ~s
279279 } ) . expect ( format ! ( "failed to exec `{}`" , cmd) ) ;
280280 let output = prog. finish_with_output ( ) ;
281281 debug ! ( "Output from command {} with args {:?} was {} \\ {{}\\ }[{:?}]" ,
282- cmd, args, str :: from_utf8( output. output) ,
283- str :: from_utf8( output. error) ,
282+ cmd, args, str :: from_utf8( output. output) . unwrap ( ) ,
283+ str :: from_utf8( output. error) . unwrap ( ) ,
284284 output. status) ;
285285 if !output. status . success ( ) {
286286 debug ! ( "Command {} {:?} failed with exit code {:?}; its output was --- {} {} ---" ,
287287 cmd, args, output. status,
288- str :: from_utf8( output. output) , str :: from_utf8( output. error) ) ;
288+ str :: from_utf8( output. output) . unwrap ( ) , str :: from_utf8( output. error) . unwrap ( ) ) ;
289289 Fail ( output)
290290 }
291291 else {
@@ -445,7 +445,7 @@ fn built_library_exists(repo: &Path, short_name: &str) -> bool {
445445fn command_line_test_output ( args : & [ ~str ] ) -> ~[ ~str ] {
446446 let mut result = ~[ ] ;
447447 let p_output = command_line_test ( args, & os:: getcwd ( ) ) ;
448- let test_output = str:: from_utf8 ( p_output. output ) ;
448+ let test_output = str:: from_utf8 ( p_output. output ) . unwrap ( ) ;
449449 for s in test_output. split ( '\n' ) {
450450 result. push ( s. to_owned ( ) ) ;
451451 }
@@ -459,7 +459,7 @@ fn command_line_test_output_with_env(args: &[~str], env: ~[(~str, ~str)]) -> ~[~
459459 Fail ( _) => fail ! ( "Command-line test failed" ) ,
460460 Success ( r) => r
461461 } ;
462- let test_output = str:: from_utf8 ( p_output. output ) ;
462+ let test_output = str:: from_utf8 ( p_output. output ) . unwrap ( ) ;
463463 for s in test_output. split ( '\n' ) {
464464 result. push ( s. to_owned ( ) ) ;
465465 }
@@ -1199,7 +1199,7 @@ fn test_uninstall() {
11991199 let workspace = create_local_package(&CrateId::new(" foo"));
12001200 command_line_test([~" uninstall", ~" foo"], workspace.path());
12011201 let output = command_line_test([~" list"], workspace.path());
1202- assert!(!str::from_utf8(output.output).contains(" foo"));
1202+ assert!(!str::from_utf8(output.output).unwrap(). contains(" foo"));
12031203}
12041204
12051205#[test]
@@ -1269,8 +1269,8 @@ fn test_extern_mod() {
12691269 let outp = prog. finish_with_output ( ) ;
12701270 if !outp. status . success ( ) {
12711271 fail ! ( "output was {}, error was {}" ,
1272- str :: from_utf8( outp. output) ,
1273- str :: from_utf8( outp. error) ) ;
1272+ str :: from_utf8( outp. output) . unwrap ( ) ,
1273+ str :: from_utf8( outp. error) . unwrap ( ) ) ;
12741274 }
12751275 assert ! ( exec_file. exists( ) && is_executable( & exec_file) ) ;
12761276}
@@ -1324,8 +1324,8 @@ fn test_extern_mod_simpler() {
13241324 let outp = prog. finish_with_output ( ) ;
13251325 if !outp. status . success ( ) {
13261326 fail ! ( "output was {}, error was {}" ,
1327- str :: from_utf8( outp. output) ,
1328- str :: from_utf8( outp. error) ) ;
1327+ str :: from_utf8( outp. output) . unwrap ( ) ,
1328+ str :: from_utf8( outp. error) . unwrap ( ) ) ;
13291329 }
13301330 assert ! ( exec_file. exists( ) && is_executable( & exec_file) ) ;
13311331}
@@ -2092,7 +2092,7 @@ fn test_rustpkg_test_creates_exec() {
20922092fn test_rustpkg_test_output() {
20932093 let workspace = create_local_package_with_test(&CrateId::new(" foo"));
20942094 let output = command_line_test([~" test", ~" foo"], workspace.path());
2095- let output_str = str::from_utf8(output.output);
2095+ let output_str = str::from_utf8(output.output).unwrap() ;
20962096 // The first two assertions are separate because test output may
20972097 // contain color codes, which could appear between " test f" and " ok".
20982098 assert!(output_str.contains(" test f"));
@@ -2123,7 +2123,7 @@ fn test_rustpkg_test_cfg() {
21232123 " #[ test] #[ cfg( not( foobar) ) ] fn f( ) { assert!( 'a' != 'a' ) ; } ");
21242124 let output = command_line_test([~" test", ~" --cfg", ~" foobar", ~" foo"],
21252125 foo_workspace);
2126- let output_str = str::from_utf8(output.output);
2126+ let output_str = str::from_utf8(output.output).unwrap() ;
21272127 assert!(output_str.contains(" 0 passed; 0 failed; 0 ignored; 0 measured"));
21282128}
21292129
@@ -2424,8 +2424,8 @@ fn correct_error_dependency() {
24242424 Fail(ProcessOutput{ error: error, output: output, .. }) => {
24252425 assert!(str::is_utf8(error));
24262426 assert!(str::is_utf8(output));
2427- let error_str = str::from_utf8(error);
2428- let out_str = str::from_utf8(output);
2427+ let error_str = str::from_utf8(error).unwrap() ;
2428+ let out_str = str::from_utf8(output).unwrap() ;
24292429 debug!(" ss = { } ", error_str);
24302430 debug!(" out_str = { } ", out_str);
24312431 if out_str.contains(" Package badpkg depends on some_package_that_doesnt_exist") &&
0 commit comments