This repository was archived by the owner on Mar 1, 2019. It is now read-only.
File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,14 @@ use std::fmt;
11
11
use std:: mem;
12
12
use std:: ops:: Deref ;
13
13
use std:: ptr;
14
+ use std:: ffi:: OsString ;
14
15
15
16
use gobject_subclass:: anyimpl:: * ;
16
17
use gobject_subclass:: object:: * ;
17
18
18
19
pub struct ArgumentList {
19
20
pub ( crate ) ptr : * mut * mut * mut libc:: c_char ,
20
- items : Vec < String > ,
21
+ items : Vec < OsString > ,
21
22
}
22
23
23
24
impl ArgumentList {
@@ -55,7 +56,7 @@ impl ArgumentList {
55
56
}
56
57
57
58
impl Deref for ArgumentList {
58
- type Target = [ String ] ;
59
+ type Target = [ OsString ] ;
59
60
60
61
fn deref ( & self ) -> & Self :: Target {
61
62
self . items . as_slice ( )
@@ -68,8 +69,8 @@ impl fmt::Debug for ArgumentList {
68
69
}
69
70
}
70
71
71
- impl convert:: Into < Vec < String > > for ArgumentList {
72
- fn into ( self ) -> Vec < String > {
72
+ impl convert:: Into < Vec < OsString > > for ArgumentList {
73
+ fn into ( self ) -> Vec < OsString > {
73
74
self . items . clone ( )
74
75
}
75
76
}
Original file line number Diff line number Diff line change @@ -68,7 +68,9 @@ mod imp {
68
68
let mut rm = Vec :: new ( ) ;
69
69
70
70
for ( i, line) in arguments. iter ( ) . enumerate ( ) {
71
- if line. starts_with ( "--local-" ) {
71
+ // TODO: we need https://github.com/rust-lang/rust/issues/49802
72
+ let l = line. clone ( ) . into_string ( ) . unwrap ( ) ;
73
+ if l. starts_with ( "--local-" ) {
72
74
rm. push ( i)
73
75
}
74
76
}
@@ -90,7 +92,9 @@ mod imp {
90
92
let arguments = cmd_line. get_arguments ( ) ;
91
93
92
94
for arg in arguments {
93
- assert ! ( !arg. starts_with( "--local-" ) )
95
+ // TODO: we need https://github.com/rust-lang/rust/issues/49802
96
+ let a = arg. into_string ( ) . unwrap ( ) ;
97
+ assert ! ( !a. starts_with( "--local-" ) )
94
98
}
95
99
96
100
return EXIT_STATUS ;
You can’t perform that action at this time.
0 commit comments