Skip to content
New issue

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

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

Already on GitHub? # to your account

chore: remove unused error struct #141

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions src/btreemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ use allocator::Allocator;
pub use iter::Iter;
use iter::{Cursor, Index};
use node::{DerivedPageSize, Entry, Node, NodeType, PageSize, Version};
use std::borrow::Cow;
use std::marker::PhantomData;
use std::ops::{Bound, RangeBounds};
use std::{borrow::Cow, fmt};

#[cfg(test)]
mod proptests;
Expand Down Expand Up @@ -1187,32 +1187,6 @@ where
}
}

/// An error returned when inserting entries into the map.
#[derive(Debug, PartialEq, Eq)]
pub enum InsertError {
KeyTooLarge { given: usize, max: usize },
ValueTooLarge { given: usize, max: usize },
}

impl fmt::Display for InsertError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::KeyTooLarge { given, max } => {
write!(
f,
"InsertError::KeyTooLarge Expected key to be <= {max} bytes but received key with {given} bytes."
)
}
Self::ValueTooLarge { given, max } => {
write!(
f,
"InsertError::ValueTooLarge Expected value to be <= {max} bytes but received value with {given} bytes."
)
}
}
}
}

#[cfg(test)]
mod test {
use super::*;
Expand Down