Skip to content

Commit

Permalink
chore: remove unused error struct (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
ielashi authored Sep 22, 2023
1 parent 4f7c8cb commit f8a85c3
Showing 1 changed file with 1 addition and 27 deletions.
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

0 comments on commit f8a85c3

Please # to comment.