char_str 0.0.1

Compact owned string types forked from lean_string for Ruff and ty.
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 [`CharString`] failed.
///
/// [`CharString`]: crate::CharString
#[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 CharString")
    }
}

impl Error for ReserveError {}