1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use crate::Operator;
pub type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Debug, thiserror::Error, miette::Diagnostic, PartialEq, Eq)]
pub enum Error {
#[error("No version filled in")]
NoVersion,
#[error("No version requirement filled in")]
NoVersionRequirement,
#[error("Operator `{0}` forbidden. Non-empty suffix is only allowed if operator is Exact of Different")]
NotAllowedOperatorWithSuffix(Operator),
#[error("Invalid operator in comparator : `{0}`")]
InvalidOperator(String),
#[error("Impossible to parse version requirement `{0}`. Operator `Exact` is forbidden in multi comparator. Consider removing either the exact operator comparator, or all others.")]
NotAllowedOperatorWithMultipleComparators(String),
#[error("Impossible to parse numeric identifier `{text}` : `{ni}` is not a number")]
ImpossibleNumericIdentifierParsing {
#[source]
err: std::num::ParseIntError,
text: String,
ni: String,
},
}