const_lru/errs.rs
1use core::fmt::{Debug, Display};
2
3/// Error type of `TryFrom<[(K, V); CAP]>`
4#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
5pub struct DuplicateKeysError<K>(
6 /// The first duplicate key found
7 pub K,
8);
9
10impl<K: Debug> Display for DuplicateKeysError<K> {
11 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12 write!(f, "duplicate key: {:#?}", self.0)
13 }
14}