Skip to content

Commit 6028be1

Browse files
Fix clippy "needless borrow" lint
1 parent 0860b3b commit 6028be1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/connection.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl Connection {
137137
// process only if we find the first entry to be a 1001
138138
if let Some(msg_1001) = Interface::from_enum(first_msg) {
139139
// get the position of the next 1001
140-
let next_1001_idx = (&messages[idx..])
140+
let next_1001_idx = messages[idx..]
141141
.iter()
142142
.position(|x| matches!(x, Message::InterfaceList(_)))
143143
.unwrap_or(messages.len() - idx)
@@ -619,7 +619,7 @@ fn parse_message(code: u32, buffer: &[u8], start_pos: usize, msg_size: usize) ->
619619
}
620620
idx += 1;
621621

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

0 commit comments

Comments
 (0)