File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -280,10 +280,10 @@ where
280
280
281
281
/// Put back a single value to the front of the iterator.
282
282
///
283
- /// If a value is already in the put back slot, it is overwritten .
283
+ /// If a value is already in the put back slot, it is returned .
284
284
#[ inline]
285
- pub fn put_back ( & mut self , x : I :: Item ) {
286
- self . top = Some ( x) ;
285
+ pub fn put_back ( & mut self , x : I :: Item ) -> Option < I :: Item > {
286
+ self . top . replace ( x)
287
287
}
288
288
}
289
289
Original file line number Diff line number Diff line change @@ -882,7 +882,7 @@ quickcheck! {
882
882
fn size_put_back( a: Vec <u8 >, x: Option <u8 >) -> bool {
883
883
let mut it = put_back( a. into_iter( ) ) ;
884
884
if let Some ( t) = x {
885
- it. put_back( t)
885
+ it. put_back( t) ;
886
886
}
887
887
correct_size_hint( it)
888
888
}
You can’t perform that action at this time.
0 commit comments