Use extend_from_slice directly in fdat_data
`write_all(_).unwrap()` compiles to exactly that anyways
This commit is contained in:
parent
58eec39cc8
commit
5937ae190f
1 changed files with 2 additions and 2 deletions
|
|
@ -68,8 +68,8 @@ impl Frame {
|
|||
#[must_use]
|
||||
pub fn fdat_data(&self, sequence_number: u32) -> Vec<u8> {
|
||||
let mut byte_data = Vec::with_capacity(4 + self.data.len());
|
||||
byte_data.write_all(&sequence_number.to_be_bytes()).unwrap();
|
||||
byte_data.write_all(&self.data).unwrap();
|
||||
byte_data.extend_from_slice(&sequence_number.to_be_bytes());
|
||||
byte_data.extend_from_slice(&self.data);
|
||||
byte_data
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue