Skip to content

Commit

Permalink
extended_note_specification: impl fmt::Display
Browse files Browse the repository at this point in the history
Adds a `Display` trait implementation for the
`QueryExtendedNoteSpecification` message.
  • Loading branch information
ebds-rs committed Aug 18, 2023
1 parent 63afb6d commit a6b6271
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/extended_note_specification/query.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
impl_extended_ops, impl_message_ops, impl_omnibus_extended_command,
len::QUERY_EXTENDED_NOTE_SPECIFICATION, ExtendedCommand, ExtendedCommandOps,
len::QUERY_EXTENDED_NOTE_SPECIFICATION, std::fmt, ExtendedCommand, ExtendedCommandOps,
ExtendedNoteReporting, MessageOps, MessageType, OmnibusCommandOps,
};

Expand Down Expand Up @@ -59,6 +59,21 @@ impl_message_ops!(QueryExtendedNoteSpecification);
impl_extended_ops!(QueryExtendedNoteSpecification);
impl_omnibus_extended_command!(QueryExtendedNoteSpecification);

impl fmt::Display for QueryExtendedNoteSpecification {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{{")?;
write!(f, r#""acknak": {}, "#, self.acknak())?;
write!(f, r#""device_type": {}, "#, self.device_type())?;
write!(f, r#""message_type": {}, "#, self.message_type())?;
write!(f, r#""extended_command": {}, "#, self.extended_command())?;
write!(f, r#""denomination": {}, "#, self.denomination())?;
write!(f, r#""operational_mode": {}, "#, self.operational_mode())?;
write!(f, r#""configuration": {}, "#, self.configuration())?;
write!(f, r#""note_index": {}"#, self.note_index())?;
write!(f, "}}")
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit a6b6271

Please sign in to comment.