mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
Convert to byte vec w/o using deprecated methods.
This commit is contained in:
parent
8943c749f3
commit
9d84890c89
1 changed files with 1 additions and 2 deletions
|
@ -1,5 +1,4 @@
|
||||||
#![crate_name = "test"]
|
#![crate_name = "test"]
|
||||||
#![feature(convert)]
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the uutils coreutils package.
|
* This file is part of the uutils coreutils package.
|
||||||
|
@ -24,7 +23,7 @@ static NAME: &'static str = "test";
|
||||||
pub fn uumain(_: Vec<String>) -> i32 {
|
pub fn uumain(_: Vec<String>) -> i32 {
|
||||||
let args = args_os().collect::<Vec<OsString>>();
|
let args = args_os().collect::<Vec<OsString>>();
|
||||||
// This is completely disregarding valid windows paths that aren't valid unicode
|
// This is completely disregarding valid windows paths that aren't valid unicode
|
||||||
let args = args.iter().map(|a| a.to_bytes().unwrap()).collect::<Vec<&[u8]>>();
|
let args = args.iter().map(|a| a.to_str().unwrap().as_bytes()).collect::<Vec<&[u8]>>();
|
||||||
if args.len() == 0 {
|
if args.len() == 0 {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue