1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 21:17:46 +00:00

Fix deprecation warnings (into_string => to_owned)

This commit is contained in:
Santiago Lapresta 2014-12-25 19:32:55 +01:00
parent 710f41c375
commit 8644b75a85
2 changed files with 8 additions and 6 deletions

View file

@ -1,5 +1,6 @@
use std::io::process::Command;
use std::io::fs::{rmdir, PathExtensions};
use std::borrow::ToOwned;
static EXE: &'static str = "./mkdir";
static TEST_DIR1: &'static str = "mkdir_test1";
@ -9,8 +10,8 @@ static TEST_DIR4: &'static str = "mkdir_test4/mkdir_test4_1";
static TEST_DIR5: &'static str = "mkdir_test5/mkdir_test5_1";
fn cleanup(dir: &'static str) {
let d = dir.into_string();
let p = Path::new(d.into_string());
let d = dir.to_owned();
let p = Path::new(d.to_owned());
if p.exists() {
rmdir(&p).unwrap();
}

View file

@ -7,6 +7,7 @@ use std::io::process::Command;
use std::io::fs::PathExtensions;
use std::io::pipe::PipeStream;
use std::str::from_utf8;
use std::borrow::ToOwned;
static EXE: &'static str = "./mv";
@ -27,8 +28,8 @@ fn run(cmd: &mut Command) -> CmdResult {
let prog = cmd.spawn().unwrap().wait_with_output().unwrap();
CmdResult {
success: prog.status.success(),
stderr: from_utf8(prog.error.as_slice()).unwrap().into_string(),
stdout: from_utf8(prog.output.as_slice()).unwrap().into_string(),
stderr: from_utf8(prog.error.as_slice()).unwrap().to_owned(),
stdout: from_utf8(prog.output.as_slice()).unwrap().to_owned(),
}
}
fn run_interactive(cmd: &mut Command, f: |&mut PipeStream|) -> CmdResult {
@ -40,8 +41,8 @@ fn run_interactive(cmd: &mut Command, f: |&mut PipeStream|) -> CmdResult {
let prog = command.wait_with_output().unwrap();
CmdResult {
success: prog.status.success(),
stderr: from_utf8(prog.error.as_slice()).unwrap().into_string(),
stdout: from_utf8(prog.output.as_slice()).unwrap().into_string(),
stderr: from_utf8(prog.error.as_slice()).unwrap().to_owned(),
stdout: from_utf8(prog.output.as_slice()).unwrap().to_owned(),
}
}