mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 13:37:48 +00:00
Fix deprecation warnings (into_string
=> to_owned
)
This commit is contained in:
parent
710f41c375
commit
8644b75a85
2 changed files with 8 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
||||||
use std::io::process::Command;
|
use std::io::process::Command;
|
||||||
use std::io::fs::{rmdir, PathExtensions};
|
use std::io::fs::{rmdir, PathExtensions};
|
||||||
|
use std::borrow::ToOwned;
|
||||||
|
|
||||||
static EXE: &'static str = "./mkdir";
|
static EXE: &'static str = "./mkdir";
|
||||||
static TEST_DIR1: &'static str = "mkdir_test1";
|
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";
|
static TEST_DIR5: &'static str = "mkdir_test5/mkdir_test5_1";
|
||||||
|
|
||||||
fn cleanup(dir: &'static str) {
|
fn cleanup(dir: &'static str) {
|
||||||
let d = dir.into_string();
|
let d = dir.to_owned();
|
||||||
let p = Path::new(d.into_string());
|
let p = Path::new(d.to_owned());
|
||||||
if p.exists() {
|
if p.exists() {
|
||||||
rmdir(&p).unwrap();
|
rmdir(&p).unwrap();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ use std::io::process::Command;
|
||||||
use std::io::fs::PathExtensions;
|
use std::io::fs::PathExtensions;
|
||||||
use std::io::pipe::PipeStream;
|
use std::io::pipe::PipeStream;
|
||||||
use std::str::from_utf8;
|
use std::str::from_utf8;
|
||||||
|
use std::borrow::ToOwned;
|
||||||
|
|
||||||
static EXE: &'static str = "./mv";
|
static EXE: &'static str = "./mv";
|
||||||
|
|
||||||
|
@ -27,8 +28,8 @@ fn run(cmd: &mut Command) -> CmdResult {
|
||||||
let prog = cmd.spawn().unwrap().wait_with_output().unwrap();
|
let prog = cmd.spawn().unwrap().wait_with_output().unwrap();
|
||||||
CmdResult {
|
CmdResult {
|
||||||
success: prog.status.success(),
|
success: prog.status.success(),
|
||||||
stderr: from_utf8(prog.error.as_slice()).unwrap().into_string(),
|
stderr: from_utf8(prog.error.as_slice()).unwrap().to_owned(),
|
||||||
stdout: from_utf8(prog.output.as_slice()).unwrap().into_string(),
|
stdout: from_utf8(prog.output.as_slice()).unwrap().to_owned(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn run_interactive(cmd: &mut Command, f: |&mut PipeStream|) -> CmdResult {
|
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();
|
let prog = command.wait_with_output().unwrap();
|
||||||
CmdResult {
|
CmdResult {
|
||||||
success: prog.status.success(),
|
success: prog.status.success(),
|
||||||
stderr: from_utf8(prog.error.as_slice()).unwrap().into_string(),
|
stderr: from_utf8(prog.error.as_slice()).unwrap().to_owned(),
|
||||||
stdout: from_utf8(prog.output.as_slice()).unwrap().into_string(),
|
stdout: from_utf8(prog.output.as_slice()).unwrap().to_owned(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue