-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
548: Remove our own error types from crossbeam-queue r=taiki-e a=taiki-e Currently, `crossbeam-queue` has two error types: `PopError`, `PushError`. * `PopError` is a unit struct with no field, and is returned by `ArrayQueue::pop` and `SegQueue::pop` if the queue is empty. * `PushError` is a tuple struct with a public field that stores the element that user tried to push, and is returned by `ArrayQueue::push` if the queue is full. I guess the current API was influenced by channels, but there is only one kind(variant) of error in each, and unlike channels, multiple kinds(variants) of errors do not occur. And, neither of these provides additional information about the error (fields are all public, so it doesn't seem like they are going to provide them in the future). So, APIs that return `Option` (on `pop` methods) and `Result` (on `ArrayQueue::push`) without our own errors are simple, and I think it is preferable. (Especially for the `pop` methods, it will be more consistent, because all other public `pop` methods in crossbeam return `Option`.) (Of course, this is a breaking change, but the master already has some breaking changes.) Co-authored-by: Taiki Endo <te316e89@gmail.com>
- Loading branch information
Showing
7 changed files
with
43 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters