Skip to content

Commit 201765b

Browse files
committed
tock-registers: Derive Default, Eq and PartialEq for FieldValue.
Default is useful to construct a FieldValue which can be passed to `modify` as a no-op or used as an additive identity when combining other FieldValues. Eq and PartialEq are useful for assertions in testing.
1 parent 0281b23 commit 201765b

File tree

1 file changed

+1
-1
lines changed
  • libraries/tock-register-interface/src

1 file changed

+1
-1
lines changed

libraries/tock-register-interface/src/fields.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Field_impl_for!(usize);
190190
///
191191
/// For the FieldValue, the masks and values are shifted into their actual
192192
/// location in the register.
193-
#[derive(Copy, Clone)]
193+
#[derive(Copy, Clone, Default, Eq, PartialEq)]
194194
pub struct FieldValue<T: UIntLike, R: RegisterLongName> {
195195
mask: T,
196196
pub value: T,

0 commit comments

Comments
 (0)