File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -51,3 +51,15 @@ impl Error for DynamicMessageError {
51
51
}
52
52
}
53
53
}
54
+
55
+ impl PartialEq for DynamicMessageError {
56
+ fn eq ( & self , other : & Self ) -> bool {
57
+ if std:: mem:: discriminant ( self ) != std:: mem:: discriminant ( other) {
58
+ return false ;
59
+ }
60
+ // TODO(luca) this is not very efficient, revisit
61
+ return self . to_string ( ) == other. to_string ( ) ;
62
+ }
63
+ }
64
+
65
+ impl Eq for DynamicMessageError { }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ use crate::dynamic_message::DynamicMessageError;
9
9
use crate :: { rcl_bindings:: * , DeclarationError } ;
10
10
11
11
/// The main error type.
12
- #[ derive( Debug ) ]
12
+ #[ derive( Debug , PartialEq , Eq ) ]
13
13
pub enum RclrsError {
14
14
/// An error originating in the `rcl` layer.
15
15
RclError {
You can’t perform that action at this time.
0 commit comments