#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct InsufficientSpace;
impl core::error::Error for InsufficientSpace {}
impl core::fmt::Display for InsufficientSpace {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "The provided buffer has no space left for encoding")
}
}
#[cfg(all(test, feature = "alloc"))]
mod tests {
use alloc::string::ToString;
use super::*;
#[test]
fn assert_that_insufficient_space_displays_correctly() {
let err = InsufficientSpace;
let msg = err.to_string();
assert_eq!(msg, "The provided buffer has no space left for encoding");
}
}