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

Implement core Error instead of std #117

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,8 +899,7 @@ pub enum ChunkError {
TooFewSlots(usize),
}

#[cfg(feature = "std")]
impl std::error::Error for ChunkError {}
impl core::error::Error for ChunkError {}

impl fmt::Display for ChunkError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
9 changes: 3 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,7 @@ pub enum PopError {
Empty,
}

#[cfg(feature = "std")]
impl std::error::Error for PopError {}
impl core::error::Error for PopError {}

impl fmt::Display for PopError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand All @@ -759,8 +758,7 @@ pub enum PeekError {
Empty,
}

#[cfg(feature = "std")]
impl std::error::Error for PeekError {}
impl core::error::Error for PeekError {}

impl fmt::Display for PeekError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand All @@ -777,8 +775,7 @@ pub enum PushError<T> {
Full(T),
}

#[cfg(feature = "std")]
impl<T> std::error::Error for PushError<T> {}
impl<T> core::error::Error for PushError<T> {}

impl<T> fmt::Debug for PushError<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down