File tree 3 files changed +16
-0
lines changed
3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -488,12 +488,20 @@ impl Iterator for Args {
488
488
fn size_hint ( & self ) -> ( usize , Option < usize > ) { self . inner . size_hint ( ) }
489
489
}
490
490
491
+ impl ExactSizeIterator for Args {
492
+ fn len ( & self ) -> usize { self . inner . len ( ) }
493
+ }
494
+
491
495
impl Iterator for ArgsOs {
492
496
type Item = OsString ;
493
497
fn next ( & mut self ) -> Option < OsString > { self . inner . next ( ) }
494
498
fn size_hint ( & self ) -> ( usize , Option < usize > ) { self . inner . size_hint ( ) }
495
499
}
496
500
501
+ impl ExactSizeIterator for ArgsOs {
502
+ fn len ( & self ) -> usize { self . inner . len ( ) }
503
+ }
504
+
497
505
/// Returns the page size of the current architecture in bytes.
498
506
pub fn page_size ( ) -> usize {
499
507
os_imp:: page_size ( )
Original file line number Diff line number Diff line change @@ -247,6 +247,10 @@ impl Iterator for Args {
247
247
fn size_hint ( & self ) -> ( usize , Option < usize > ) { self . iter . size_hint ( ) }
248
248
}
249
249
250
+ impl ExactSizeIterator for Args {
251
+ fn len ( & self ) -> usize { self . iter . len ( ) }
252
+ }
253
+
250
254
/// Returns the command line arguments
251
255
///
252
256
/// Returns a list of the command line arguments.
Original file line number Diff line number Diff line change @@ -303,6 +303,10 @@ impl Iterator for Args {
303
303
fn size_hint ( & self ) -> ( usize , Option < usize > ) { self . range . size_hint ( ) }
304
304
}
305
305
306
+ impl ExactSizeIterator for Args {
307
+ fn len ( & self ) -> usize { self . range . len ( ) }
308
+ }
309
+
306
310
impl Drop for Args {
307
311
fn drop ( & mut self ) {
308
312
unsafe { c:: LocalFree ( self . cur as * mut c_void ) ; }
You can’t perform that action at this time.
0 commit comments