Skip to content

Commit

Permalink
Fix clippy "needless borrow" lint
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksanderkrauze committed Jun 12, 2023
1 parent 0860b3b commit 6028be1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl Connection {
// process only if we find the first entry to be a 1001
if let Some(msg_1001) = Interface::from_enum(first_msg) {
// get the position of the next 1001
let next_1001_idx = (&messages[idx..])
let next_1001_idx = messages[idx..]
.iter()
.position(|x| matches!(x, Message::InterfaceList(_)))
.unwrap_or(messages.len() - idx)
Expand Down Expand Up @@ -619,7 +619,7 @@ fn parse_message(code: u32, buffer: &[u8], start_pos: usize, msg_size: usize) ->
}
idx += 1;

if let Some(nl_pos) = (&buffer[pos..]).iter().position(|it| *it == b'\n') {
if let Some(nl_pos) = buffer[pos..].iter().position(|it| *it == b'\n') {
let src = &buffer[pos..(pos + nl_pos)];
v.extend_from_slice(src);
pos += src.len() + 1;
Expand Down

0 comments on commit 6028be1

Please sign in to comment.