2 Commits

Author SHA1 Message Date
a2673c9870 make ToBeBytes trait public
Some checks failed
Rust/spacepackets/pipeline/head There was a failure building this commit
2022-10-23 18:35:56 +02:00
603f688ac3 small clippy fix
Some checks failed
Rust/spacepackets/pipeline/head There was a failure building this commit
2022-10-15 19:56:17 +02:00
2 changed files with 3 additions and 3 deletions

View File

@@ -171,7 +171,7 @@ pub trait EcssEnumeration {
fn write_to_bytes(&self, buf: &mut [u8]) -> Result<(), ByteConversionError>;
}
trait ToBeBytes {
pub trait ToBeBytes {
type ByteArray: AsRef<[u8]>;
fn to_be_bytes(&self) -> Self::ByteArray;
}

View File

@@ -136,7 +136,7 @@ impl PacketId {
sec_header_flag,
apid: 0,
};
pid.set_apid(apid).then(|| pid)
pid.set_apid(apid).then_some(pid)
}
/// Set a new Application Process ID (APID). If the passed number is invalid, the APID will
@@ -182,7 +182,7 @@ impl PacketSequenceCtrl {
seq_flags,
seq_count: 0,
};
psc.set_seq_count(seq_count).then(|| psc)
psc.set_seq_count(seq_count).then_some(psc)
}
pub fn raw(&self) -> u16 {
((self.seq_flags as u16) << 14) | self.seq_count