rust(lint): fix some usages of references

- ref is discouraged for top level variables
- the other borrow is not required
pull/6304/head
Jason Ish 4 years ago committed by Victor Julien
parent d0772e04b1
commit d5c0962299

@ -742,7 +742,7 @@ fn dns_log_json_failure_v1(r: &DNSResponse, index: usize, flags: u64)
return Ok(None);
}
let ref query = r.queries[index];
let query = &r.queries[index];
if !dns_log_rrtype_enabled(query.rrtype, flags) {
return Ok(None);

@ -53,7 +53,7 @@ pub fn le_slice_to_string(input: &[u8]) -> Result<String, Box<dyn std::error::Er
pub fn utf7_slice_to_string(input: &[u8]) -> Result<String, Box<dyn std::error::Error>> {
let s = match memchr(b'\0', input) {
Some(end) => &input[..end],
None => &input[..],
None => input,
};
match std::str::from_utf8(s) {
Ok(s) => Ok(String::from(s)),

Loading…
Cancel
Save