fm_index/
error.rs

1/// An error that can occur when constructing a search index.
2#[derive(Debug)]
3pub enum Error {
4    /// The provided text is invalid.
5    InvalidText(&'static str),
6}
7
8impl std::fmt::Display for Error {
9    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10        match self {
11            Error::InvalidText(msg) => write!(f, "invalid text: {}", msg,),
12        }
13    }
14}
15
16impl std::error::Error for Error {
17    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
18        None
19    }
20}