File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -274,7 +274,7 @@ impl Default for Cmd {
274
274
275
275
impl Cmd {
276
276
pub fn add_arg ( mut self , arg : OsString ) -> Self {
277
- let arg_str = arg. clone ( ) . into_string ( ) . unwrap ( ) ;
277
+ let arg_str = arg. to_string_lossy ( ) . to_string ( ) ;
278
278
if self . args . is_empty ( ) {
279
279
let v: Vec < & str > = arg_str. split ( '=' ) . collect ( ) ;
280
280
if v. len ( ) == 2 && v[ 0 ] . chars ( ) . all ( |c| c. is_ascii_alphanumeric ( ) || c == '_' ) {
@@ -354,7 +354,7 @@ impl Cmd {
354
354
args : self
355
355
. args
356
356
. into_iter ( )
357
- . map ( |s| s. into_string ( ) . unwrap ( ) )
357
+ . map ( |s| s. to_string_lossy ( ) . to_string ( ) )
358
358
. collect ( ) ,
359
359
vars : self . vars ,
360
360
current_dir : if current_dir. as_os_str ( ) . is_empty ( ) {
@@ -578,7 +578,7 @@ impl CmdString {
578
578
}
579
579
impl fmt:: Display for CmdString {
580
580
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
581
- f. write_str ( & self . 0 . to_str ( ) . unwrap ( ) . to_string ( ) )
581
+ f. write_str ( & self . 0 . to_string_lossy ( ) )
582
582
}
583
583
}
584
584
You can’t perform that action at this time.
0 commit comments