Skip to content

Commit

Permalink
Use a slice instead of a reference to a vector
Browse files Browse the repository at this point in the history
  • Loading branch information
marmeladema authored and dwrensha committed Aug 31, 2022
1 parent b5f6761 commit 88d3e03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion capnp/src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ pub mod test {
read_segment_table, write_segment_table, write_segments};

/// Writes segments as if they were a Capnproto message.
pub fn write_message_segments<W>(write: &mut W, segments: &Vec<Vec<crate::Word>>) where W: Write {
pub fn write_message_segments<W>(write: &mut W, segments: &[Vec<crate::Word>]) where W: Write {
let borrowed_segments: &[&[u8]] = &segments.iter()
.map(|segment| crate::Word::words_to_bytes(&segment[..]))
.collect::<Vec<_>>()[..];
Expand Down

0 comments on commit 88d3e03

Please sign in to comment.