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() {
1212}
1313
1414pub struct Args {
15- iter : vec:: IntoIter < Vec < u8 > > ,
15+ iter : vec:: IntoIter < OsString > ,
1616 _dont_send_or_sync_me : PhantomData < * mut ( ) > ,
1717}
1818
1919/// Returns the command line arguments
2020pub fn args ( ) -> Args {
21+ let mut buf = Vec :: new ( ) ;
22+ let _ = wasi:: get_args ( |arg| buf. push ( OsString :: from_vec ( arg. to_vec ( ) ) ) ) ;
2123 Args {
22- iter : wasi :: get_args ( ) . unwrap_or ( Vec :: new ( ) ) . into_iter ( ) ,
24+ iter : buf . into_iter ( ) ,
2325 _dont_send_or_sync_me : PhantomData
2426 }
2527}
@@ -33,7 +35,7 @@ impl Args {
3335impl Iterator for Args {
3436 type Item = OsString ;
3537 fn next ( & mut self ) -> Option < OsString > {
36- self . iter . next ( ) . map ( OsString :: from_vec )
38+ self . iter . next ( )
3739 }
3840 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
3941 self . iter . size_hint ( )
You can’t perform that action at this time.
0 commit comments