mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Make GroupsPathError and MetadataRetrievalError enums non-exhaustive
This commit is contained in:
+2
-2
@@ -140,7 +140,7 @@ impl From<GroupsPathError> for VerboseError {
|
||||
match value {
|
||||
GroupsPathError::UndefinedGroup(g) => Self::UndefinedGroupError(g),
|
||||
GroupsPathError::CycleFound(cycle) => Self::CyclicInteractionError(cycle),
|
||||
GroupsPathError::PathfindingError(_) => Self::Other(Box::new(value)),
|
||||
GroupsPathError::PathfindingError(_) | _ => Self::Other(Box::new(value)),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ impl From<MetadataRetrievalError> for VerboseError {
|
||||
fn from(value: MetadataRetrievalError) -> Self {
|
||||
match value {
|
||||
MetadataRetrievalError::ConditionEvaluationError(e) => e.into(),
|
||||
MetadataRetrievalError::RegexError(_) => Self::Other(Box::new(value)),
|
||||
MetadataRetrievalError::RegexError(_) | _ => Self::Other(Box::new(value)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ impl From<GroupsPathError> for VerboseError {
|
||||
match value {
|
||||
GroupsPathError::UndefinedGroup(g) => Self::UndefinedGroupError(g),
|
||||
GroupsPathError::CycleFound(cycle) => Self::CyclicInteractionError(cycle),
|
||||
GroupsPathError::PathfindingError(_) => Self::Other(Box::new(value)),
|
||||
GroupsPathError::PathfindingError(_) | _ => Self::Other(Box::new(value)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ impl From<loot_condition_interpreter::Error> for ConditionEvaluationError {
|
||||
|
||||
/// Represents an error that occurred while retrieving metadata for a plugin.
|
||||
#[derive(Debug)]
|
||||
#[non_exhaustive]
|
||||
pub enum MetadataRetrievalError {
|
||||
ConditionEvaluationError(ConditionEvaluationError),
|
||||
RegexError(RegexError),
|
||||
|
||||
@@ -66,6 +66,7 @@ pub(crate) fn display_cycle(cycle: &[Vertex]) -> String {
|
||||
/// Represents an error that occurred while trying to get the path between two
|
||||
/// groups across the graph formed from group metadata.
|
||||
#[derive(Debug)]
|
||||
#[non_exhaustive]
|
||||
pub enum GroupsPathError {
|
||||
UndefinedGroup(String),
|
||||
CycleFound(Vec<Vertex>),
|
||||
|
||||
Reference in New Issue
Block a user