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

Make Bound helpers return Option<Self> #644

Closed
maurolacy opened this issue Jan 31, 2022 · 1 comment
Closed

Make Bound helpers return Option<Self> #644

maurolacy opened this issue Jan 31, 2022 · 1 comment

Comments

@maurolacy
Copy link
Contributor

maurolacy commented Jan 31, 2022

Now that we are using helpers for building Bounds, let's improve the syntax by making those helpers return Option<Bound> directly.

So that instead of Some(Bound::inclusive(key)) or Some(Bound::exclusive(key)), we can just write Bound::inclusive(key) / Bound::exclusive(key).

@maurolacy maurolacy changed the title Make Bound helpers to return Option Make Bound helpers return Option<Self> Jan 31, 2022
@maurolacy
Copy link
Contributor Author

The biggest problem with this is that returning Option<Bound> will break the way we currently map our way through optional bounds:

let start = start_after.as_ref().map(Bound::exclusive);

So, voting for closing this without implementing it.

Please re-open if you see a viable alternative here.

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

No branches or pull requests

1 participant