diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2013-12-23 17:45:01 +0100 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2014-01-21 15:48:48 -0800 |
| commit | 05ae134acebee3f35af4880de113a7ae7ce20002 (patch) | |
| tree | 096daf1c7c42bd04ac3d1f11f710fd9786d9937a /src/libstd/run.rs | |
| parent | b8c41492939c77b7139e46ee67375b47041f6692 (diff) | |
| download | rust-05ae134acebee3f35af4880de113a7ae7ce20002.tar.gz rust-05ae134acebee3f35af4880de113a7ae7ce20002.zip | |
[std::str] Rename from_utf8_owned_opt() to from_utf8_owned(), drop the old from_utf8_owned() behavior
Diffstat (limited to 'src/libstd/run.rs')
| -rw-r--r-- | src/libstd/run.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libstd/run.rs b/src/libstd/run.rs index 3595a7d45ac..f460d3f4944 100644 --- a/src/libstd/run.rs +++ b/src/libstd/run.rs @@ -372,7 +372,7 @@ mod tests { let run::ProcessOutput {status, output, error} = run::process_output("echo", [~"hello"]).expect("failed to exec `echo`"); - let output_str = str::from_utf8_owned(output); + let output_str = str::from_utf8_owned(output).unwrap(); assert!(status.success()); assert_eq!(output_str.trim().to_owned(), ~"hello"); @@ -439,7 +439,7 @@ mod tests { None => break } } - str::from_utf8_owned(res) + str::from_utf8_owned(res).unwrap() } #[test] @@ -467,7 +467,7 @@ mod tests { .expect("failed to exec `echo`"); let run::ProcessOutput {status, output, error} = prog.finish_with_output(); - let output_str = str::from_utf8_owned(output); + let output_str = str::from_utf8_owned(output).unwrap(); assert!(status.success()); assert_eq!(output_str.trim().to_owned(), ~"hello"); @@ -486,7 +486,7 @@ mod tests { let run::ProcessOutput {status, output, error} = prog.finish_with_output(); - let output_str = str::from_utf8_owned(output); + let output_str = str::from_utf8_owned(output).unwrap(); assert!(status.success()); assert_eq!(output_str.trim().to_owned(), ~"hello"); @@ -533,7 +533,7 @@ mod tests { fn test_keep_current_working_dir() { let mut prog = run_pwd(None); - let output = str::from_utf8_owned(prog.finish_with_output().output); + let output = str::from_utf8_owned(prog.finish_with_output().output).unwrap(); let parent_dir = os::getcwd(); let child_dir = Path::new(output.trim()); @@ -551,7 +551,7 @@ mod tests { let parent_dir = os::getcwd().dir_path(); let mut prog = run_pwd(Some(&parent_dir)); - let output = str::from_utf8_owned(prog.finish_with_output().output); + let output = str::from_utf8_owned(prog.finish_with_output().output).unwrap(); let child_dir = Path::new(output.trim()); let parent_stat = parent_dir.stat(); @@ -590,7 +590,7 @@ mod tests { if running_on_valgrind() { return; } let mut prog = run_env(None); - let output = str::from_utf8_owned(prog.finish_with_output().output); + let output = str::from_utf8_owned(prog.finish_with_output().output).unwrap(); let r = os::env(); for &(ref k, ref v) in r.iter() { @@ -604,7 +604,7 @@ mod tests { if running_on_valgrind() { return; } let mut prog = run_env(None); - let output = str::from_utf8_owned(prog.finish_with_output().output); + let output = str::from_utf8_owned(prog.finish_with_output().output).unwrap(); let r = os::env(); for &(ref k, ref v) in r.iter() { @@ -623,7 +623,7 @@ mod tests { new_env.push((~"RUN_TEST_NEW_ENV", ~"123")); let mut prog = run_env(Some(new_env)); - let output = str::from_utf8_owned(prog.finish_with_output().output); + let output = str::from_utf8_owned(prog.finish_with_output().output).unwrap(); assert!(output.contains("RUN_TEST_NEW_ENV=123")); } |
