@@ -142,13 +142,29 @@ impl Iterator for Vars {
142
142
} )
143
143
}
144
144
fn size_hint ( & self ) -> ( usize , Option < usize > ) { self . inner . size_hint ( ) }
145
+ fn count ( self ) -> usize { self . inner . count ( ) }
146
+ fn nth ( & mut self , n : usize ) -> Option < ( String , String ) > {
147
+ self . inner . nth ( n) . map ( |( a, b) | {
148
+ ( a. into_string ( ) . unwrap ( ) , b. into_string ( ) . unwrap ( ) )
149
+ } )
150
+ }
151
+ fn last ( self ) -> Option < ( String , String ) > {
152
+ self . inner . last ( ) . map ( |( a, b) | {
153
+ ( a. into_string ( ) . unwrap ( ) , b. into_string ( ) . unwrap ( ) )
154
+ } )
155
+ }
145
156
}
146
157
147
158
#[ stable( feature = "env" , since = "1.0.0" ) ]
148
159
impl Iterator for VarsOs {
149
160
type Item = ( OsString , OsString ) ;
150
161
fn next ( & mut self ) -> Option < ( OsString , OsString ) > { self . inner . next ( ) }
151
162
fn size_hint ( & self ) -> ( usize , Option < usize > ) { self . inner . size_hint ( ) }
163
+ fn count ( self ) -> usize { self . inner . count ( ) }
164
+ fn nth ( & mut self , n : usize ) -> Option < ( OsString , OsString ) > {
165
+ self . inner . nth ( n)
166
+ }
167
+ fn last ( self ) -> Option < ( OsString , OsString ) > { self . inner . last ( ) }
152
168
}
153
169
154
170
/// Fetches the environment variable `key` from the current process.
0 commit comments