1 2 3 4 5 6 7 8 9 10 11 12 13 14
#[derive(Debug, Clone, PartialEq)] pub struct Error { pub message: String, pub position: usize, } impl Error { pub fn new(message: impl Into<String>, position: usize) -> Self { Self { message: message.into(), position, } } }