Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a try_remove method #89

Merged
merged 4 commits into from
Jun 7, 2021
Merged

Add a try_remove method #89

merged 4 commits into from
Jun 7, 2021

Conversation

aym-v
Copy link
Contributor

@aym-v aym-v commented Mar 14, 2021

This PR adds a try_remove method that returns an Option on remove operations. It is necessary to add a tokio_util::time::DelayQueue::try_remove method.

tests/slab.rs Outdated Show resolved Hide resolved
@qm3ster
Copy link

qm3ster commented Mar 20, 2021

That is one nice looking git diff!

@taiki-e
Copy link
Member

taiki-e commented Apr 10, 2021

See also rust-lang/rust#77480

@qm3ster
Copy link

qm3ster commented Apr 27, 2021

Disposition to merge?

@zeenix
Copy link

zeenix commented Jun 7, 2021

Disposition to merge?

@taiki-e ? Apart from other general benefits from this, we can also get rid of the TODO here from a project we both maintain these days. :)

@taiki-e
Copy link
Member

taiki-e commented Jun 7, 2021

Sorry for the late review! Personally, for slab, I tend to prefer to return Option on remove like map or arena, rather than panic on remove like Vec. That said, changing remove is a breaking change, and we want to avoid major version bumps. Therefore, I think this is actually a reasonable solution...

Copy link
Member

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aym-v!

@taiki-e taiki-e merged commit eb0ad4e into tokio-rs:master Jun 7, 2021
@taiki-e taiki-e mentioned this pull request Aug 6, 2021
@taiki-e
Copy link
Member

taiki-e commented Aug 6, 2021

Published in v0.4.4.

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.

4 participants