File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,16 @@ pub unsafe fn cleanup() {
12
12
}
13
13
14
14
pub struct Args {
15
- iter : vec:: IntoIter < Vec < u8 > > ,
15
+ iter : vec:: IntoIter < OsString > ,
16
16
_dont_send_or_sync_me : PhantomData < * mut ( ) > ,
17
17
}
18
18
19
19
/// Returns the command line arguments
20
20
pub fn args ( ) -> Args {
21
+ let mut buf = Vec :: new ( ) ;
22
+ let _ = wasi:: get_args ( |arg| buf. push ( OsString :: from_vec ( arg. to_vec ( ) ) ) ) ;
21
23
Args {
22
- iter : wasi :: get_args ( ) . unwrap_or ( Vec :: new ( ) ) . into_iter ( ) ,
24
+ iter : buf . into_iter ( ) ,
23
25
_dont_send_or_sync_me : PhantomData
24
26
}
25
27
}
@@ -33,7 +35,7 @@ impl Args {
33
35
impl Iterator for Args {
34
36
type Item = OsString ;
35
37
fn next ( & mut self ) -> Option < OsString > {
36
- self . iter . next ( ) . map ( OsString :: from_vec )
38
+ self . iter . next ( )
37
39
}
38
40
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
39
41
self . iter . size_hint ( )
You can’t perform that action at this time.
0 commit comments