Skip to content

Commit 8d20f5d

Browse files
committed
Add several derives
CompatibilityError and ValidSubElementInfo now have Clone, Debug, PartialEq Add PartialEq to ArxmlParserError
1 parent fbd356d commit 8d20f5d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

autosar-data/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ pub enum AutosarDataError {
167167
ioerror: std::io::Error,
168168
},
169169

170-
/// `DuplicateFilenameError`: The model can'#'t contain two files with identical names
170+
/// `DuplicateFilenameError`: The model can't contain two files with identical names
171171
#[error("Could not {verb} file {}: A file with this name is already loaded", .filename.to_string_lossy())]
172172
DuplicateFilenameError {
173173
/// description of the operation that failed
@@ -454,6 +454,7 @@ pub(crate) enum ElementOrModel {
454454
}
455455

456456
/// Possible kinds of compatibility errors that can be found by `ArxmlFile::check_version_compatibility()`
457+
#[derive(Debug, PartialEq, Clone)]
457458
pub enum CompatibilityError {
458459
/// The element is not allowed in the target version
459460
IncompatibleElement {
@@ -487,6 +488,7 @@ pub enum CompatibilityError {
487488
/// information about a sub element
488489
///
489490
/// This structure is returned by [`Element::list_valid_sub_elements()`]
491+
#[derive(Debug, PartialEq, Clone)]
490492
pub struct ValidSubElementInfo {
491493
/// name of the potential sub element
492494
pub element_name: ElementName,

autosar-data/src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::{
1515
Attribute, AutosarDataError, CharacterData, Element, ElementContent, ElementOrModel, ElementRaw, WeakElement,
1616
};
1717

18-
#[derive(Debug, Error)]
18+
#[derive(Debug, Error, PartialEq)]
1919
#[non_exhaustive]
2020
/// `ArxmlParserError` contains all the errors that can occur while parsing a file
2121
pub enum ArxmlParserError {

0 commit comments

Comments
 (0)