Skip to content

Conversation

@SimonSapin
Copy link
Contributor

No description provided.

@SimonSapin
Copy link
Contributor Author

The name is unfortunately close to the existing peek_ method, but the behavior is different.

@bluss
Copy link
Contributor

bluss commented Aug 8, 2013

This is very useful, basically an identical adaptor is going in with the TreeMap/union/intersection iterator changes, and can be refactored to use peekable as soon as this merges.

… that copies the returned value, and thus does not freeze the iterator..
@bluss
Copy link
Contributor

bluss commented Aug 10, 2013

We don't strictly need .peek_clone(); it can be removed if it's contentious? extra::tremap would look great using .peek(): https://github.com/blake2-ppc/rust/commit/d33a2e658536160759992e6a32c4259fe01225ff

@thestinger
Copy link
Contributor

@blake2-ppc: I think I would rather just have peek as long as there's a way to get the same behaviour as peek_clone without hitting a borrow checking error - can you open a PR with the treemap changes included?

@bluss
Copy link
Contributor

bluss commented Aug 10, 2013

It's possible. .peek_clone is Something like .peek().map(|x| (**x).clone()) (just deref enough to clone the right thing)

@bluss
Copy link
Contributor

bluss commented Aug 10, 2013

Rebased & combined with treemap changes in the new PR. peek_clone was removed, Hope this is ok simon!

@SimonSapin
Copy link
Contributor Author

Sure @blake2-ppc , that’s fine. Closing this in favor of #8428.

@SimonSapin SimonSapin closed this Aug 10, 2013
bors added a commit that referenced this pull request Aug 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants