File tree 8 files changed +27
-32
lines changed
8 files changed +27
-32
lines changed Original file line number Diff line number Diff line change @@ -799,7 +799,7 @@ impl DoubleEndedIterator for Args {
799
799
#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
800
800
impl fmt:: Debug for Args {
801
801
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
802
- f. debug_struct ( "Args" ) . field ( "inner" , & self . inner . inner . inner_debug ( ) ) . finish ( )
802
+ f. debug_struct ( "Args" ) . field ( "inner" , & self . inner . inner ) . finish ( )
803
803
}
804
804
}
805
805
@@ -840,7 +840,7 @@ impl DoubleEndedIterator for ArgsOs {
840
840
#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
841
841
impl fmt:: Debug for ArgsOs {
842
842
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
843
- f. debug_struct ( "ArgsOs" ) . field ( "inner" , & self . inner . inner_debug ( ) ) . finish ( )
843
+ f. debug_struct ( "ArgsOs" ) . field ( "inner" , & self . inner ) . finish ( )
844
844
}
845
845
}
846
846
Original file line number Diff line number Diff line change 1
1
use crate :: ffi:: OsString ;
2
+ use crate :: fmt;
2
3
use crate :: marker:: PhantomData ;
3
4
use crate :: vec;
4
5
@@ -22,9 +23,9 @@ pub struct Args {
22
23
_dont_send_or_sync_me : PhantomData < * mut ( ) > ,
23
24
}
24
25
25
- impl Args {
26
- pub fn inner_debug ( & self ) -> & [ OsString ] {
27
- self . iter . as_slice ( )
26
+ impl fmt :: Debug for Args {
27
+ fn fmt ( & self , f : & mut fmt :: Formatter < ' _ > ) -> fmt :: Result {
28
+ self . iter . as_slice ( ) . fmt ( f )
28
29
}
29
30
}
30
31
Original file line number Diff line number Diff line change 1
1
use super :: abi:: usercalls:: { alloc, raw:: ByteBuffer } ;
2
2
use crate :: ffi:: OsString ;
3
+ use crate :: fmt;
3
4
use crate :: slice;
4
5
use crate :: sync:: atomic:: { AtomicUsize , Ordering } ;
5
6
use crate :: sys:: os_str:: Buf ;
@@ -31,9 +32,9 @@ pub fn args() -> Args {
31
32
32
33
pub struct Args ( slice:: Iter < ' static , OsString > ) ;
33
34
34
- impl Args {
35
- pub fn inner_debug ( & self ) -> & [ OsString ] {
36
- self . 0 . as_slice ( )
35
+ impl fmt :: Debug for Args {
36
+ fn fmt ( & self , f : & mut fmt :: Formatter < ' _ > ) -> fmt :: Result {
37
+ self . 0 . as_slice ( ) . fmt ( f )
37
38
}
38
39
}
39
40
Original file line number Diff line number Diff line change 6
6
#![ allow( dead_code) ] // runtime init functions not used during testing
7
7
8
8
use crate :: ffi:: OsString ;
9
+ use crate :: fmt;
9
10
use crate :: marker:: PhantomData ;
10
11
use crate :: vec;
11
12
@@ -29,9 +30,9 @@ pub struct Args {
29
30
_dont_send_or_sync_me : PhantomData < * mut ( ) > ,
30
31
}
31
32
32
- impl Args {
33
- pub fn inner_debug ( & self ) -> & [ OsString ] {
34
- self . iter . as_slice ( )
33
+ impl fmt :: Debug for Args {
34
+ fn fmt ( & self , f : & mut fmt :: Formatter < ' _ > ) -> fmt :: Result {
35
+ self . iter . as_slice ( ) . fmt ( f )
35
36
}
36
37
}
37
38
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ pub fn args() -> Args {
9
9
Args { }
10
10
}
11
11
12
- impl Args {
13
- pub fn inner_debug ( & self ) -> & [ OsString ] {
14
- & [ ]
12
+ impl fmt :: Debug for Args {
13
+ fn fmt ( & self , f : & mut fmt :: Formatter < ' _ > ) -> fmt :: Result {
14
+ f . debug_list ( ) . finish ( )
15
15
}
16
16
}
17
17
Original file line number Diff line number Diff line change 1
1
#![ deny( unsafe_op_in_unsafe_fn) ]
2
2
3
3
use crate :: ffi:: { CStr , OsStr , OsString } ;
4
+ use crate :: fmt;
4
5
use crate :: marker:: PhantomData ;
5
6
use crate :: os:: wasi:: ffi:: OsStrExt ;
6
7
use crate :: vec;
@@ -38,9 +39,9 @@ fn maybe_args() -> Option<Vec<OsString>> {
38
39
}
39
40
}
40
41
41
- impl Args {
42
- pub fn inner_debug ( & self ) -> & [ OsString ] {
43
- self . iter . as_slice ( )
42
+ impl fmt :: Debug for Args {
43
+ fn fmt ( & self , f : & mut fmt :: Formatter < ' _ > ) -> fmt :: Result {
44
+ self . iter . as_slice ( ) . fmt ( f )
44
45
}
45
46
}
46
47
Original file line number Diff line number Diff line change 1
1
use crate :: ffi:: OsString ;
2
+ use crate :: fmt;
2
3
use crate :: marker:: PhantomData ;
3
4
use crate :: vec;
4
5
@@ -17,9 +18,9 @@ pub struct Args {
17
18
_dont_send_or_sync_me : PhantomData < * mut ( ) > ,
18
19
}
19
20
20
- impl Args {
21
- pub fn inner_debug ( & self ) -> & [ OsString ] {
22
- self . iter . as_slice ( )
21
+ impl fmt :: Debug for Args {
22
+ fn fmt ( & self , f : & mut fmt :: Formatter < ' _ > ) -> fmt :: Result {
23
+ self . iter . as_slice ( ) . fmt ( f )
23
24
}
24
25
}
25
26
Original file line number Diff line number Diff line change @@ -164,19 +164,9 @@ pub struct Args {
164
164
parsed_args_list : vec:: IntoIter < OsString > ,
165
165
}
166
166
167
- pub struct ArgsInnerDebug < ' a > {
168
- args : & ' a Args ,
169
- }
170
-
171
- impl < ' a > fmt:: Debug for ArgsInnerDebug < ' a > {
167
+ impl fmt:: Debug for Args {
172
168
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
173
- self . args . parsed_args_list . as_slice ( ) . fmt ( f)
174
- }
175
- }
176
-
177
- impl Args {
178
- pub fn inner_debug ( & self ) -> ArgsInnerDebug < ' _ > {
179
- ArgsInnerDebug { args : self }
169
+ self . parsed_args_list . as_slice ( ) . fmt ( f)
180
170
}
181
171
}
182
172
You can’t perform that action at this time.
0 commit comments