Debian Codegraph @

debian/rust-vendor/tinystr/src/error.rs

raw
1 // This file is part of ICU4X. For terms of use, please see the file
2 // called LICENSE at the top level of the ICU4X source tree
3 // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5 use displaydoc::Display;
6
7 impl core::error::Error for ParseError {}
8
9 #[derive(Display, Debug, PartialEq, Eq)]
10 #[non_exhaustive]
11 pub enum ParseError {
12 #[displaydoc("found string of larger length {len} when constructing string of length {max}")]
13 TooLong { max: usize, len: usize },
14 #[displaydoc("tinystr types do not support strings with null bytes")]
15 ContainsNull,
16 #[displaydoc("attempted to construct TinyAsciiStr from a non-ASCII string")]
17 NonAscii,
18 }