Skip to content

Add touch function, Debug and Clone#12

Merged
mbrubeck merged 2 commits into
servo:masterfrom
avitex:master
Jul 16, 2020
Merged

Add touch function, Debug and Clone#12
mbrubeck merged 2 commits into
servo:masterfrom
avitex:master

Conversation

@avitex

@avitex avitex commented Jun 17, 2020

Copy link
Copy Markdown
Contributor
  • added public touch function based on a predicate
  • moved private functions to bottom
  • added Debug and Clone support
  • renamed LRUCacheMutIterator to IterMut

avitex added 2 commits June 17, 2020 12:38
* added public touch function based on a predicate
* moved private functions to bottom
* added Debug and Clone support
* renamed LRUCacheMutIterator to IterMut
@avitex

avitex commented Jun 17, 2020

Copy link
Copy Markdown
Contributor Author

Reasoning behind touch function was no public functions expose the inner indexes, but I needed a way of touching an entry and getting an immutable reference to its data. I could have find and then front, but it didn't feel explicit. I think this offers a better solution.

@avitex avitex mentioned this pull request Jun 17, 2020
3 tasks
@avitex

avitex commented Jun 23, 2020

Copy link
Copy Markdown
Contributor Author

Currently blocked on release with this PR, any chance for a review?

@mbrubeck mbrubeck merged commit 6791c78 into servo:master Jul 16, 2020
mbrubeck added a commit that referenced this pull request Jul 17, 2020
* Add `touch` method to moves the matching item to the front (#12).
* `LRUCache` now implements `Debug` and `Clone`.
@mbrubeck

Copy link
Copy Markdown
Collaborator

This looks great, thanks! I have published a new version that includes these changes.

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.

2 participants