Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/adaptors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ where

/// Put back a single value to the front of the iterator.
///
/// If a value is already in the put back slot, it is overwritten.
/// If a value is already in the put back slot, it is returned.
#[inline]
pub fn put_back(&mut self, x: I::Item) {
self.top = Some(x);
pub fn put_back(&mut self, x: I::Item) -> Option<I::Item> {
self.top.replace(x)
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/quick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ quickcheck! {
fn size_put_back(a: Vec<u8>, x: Option<u8>) -> bool {
let mut it = put_back(a.into_iter());
if let Some(t) = x {
it.put_back(t)
it.put_back(t);
}
correct_size_hint(it)
}
Expand Down