ito_common/id/error.rs
1#[derive(Debug, Clone, PartialEq, Eq)]
2/// Error returned when parsing an Ito identifier fails.
3pub struct IdParseError {
4 /// Human-readable error message.
5 pub error: String,
6
7 /// Optional hint describing a common fix.
8 pub hint: Option<String>,
9}
10
11impl IdParseError {
12 pub(crate) fn new(error: impl Into<String>, hint: Option<impl Into<String>>) -> Self {
13 Self {
14 error: error.into(),
15 hint: hint.map(|h| h.into()),
16 }
17 }
18}