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

Consider returning an error instead of an option when full #46

Closed
tbu- opened this issue Mar 18, 2017 · 1 comment
Closed

Consider returning an error instead of an option when full #46

tbu- opened this issue Mar 18, 2017 · 1 comment

Comments

@tbu-
Copy link
Collaborator

tbu- commented Mar 18, 2017

A version bump would make this possible: This affects methods like push, insert, etc.: In order to easily assert or bubble up the error, it would be nice if these methods returned Results instead of Options. This way, you can both implement From to convert it to your own error type and use unwrap for an easy "this is a bug" marker. Additionally, it warns if the result is unused.

@bluss
Copy link
Owner

bluss commented Jul 30, 2017

It has been wished the ArrayVec has an API more similar to the Vec. That's what going to happen for the next version, so insert can't return a Result.

New method try_insert will return a Result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants