lean_string 0.5.1

Compact, clone-on-write string.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use core::{error::Error, fmt};

/// An error if allocating or resizing a [`LeanString`] failed.
///
/// [`LeanString`]: crate::LeanString
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct ReserveError;

impl fmt::Display for ReserveError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.write_str("Cannot allocate memory to hold LeanString")
    }
}

impl Error for ReserveError {}