rust/clippy: fix lint: never_loop

pull/8251/head
Jason Ish 4 years ago committed by Victor Julien
parent e8823644ec
commit 7c293ff68f

@ -512,10 +512,9 @@ fn dns_log_json_answer(js: &mut JsonBuilder, response: &DNSResponse, flags: u64)
js.set_bool("z", true)?;
}
for query in &response.queries {
if let Some(query) = response.queries.first() {
js.set_string_from_bytes("rrname", &query.name)?;
js.set_string("rrtype", &dns_rrtype_string(query.rrtype))?;
break;
}
js.set_string("rcode", &dns_rcode_string(header.flags))?;

@ -42,12 +42,12 @@ pub extern "C" fn rs_dns_lua_get_rrname(clua: &mut CLuaState,
};
if let &Some(ref request) = &tx.request {
for query in &request.queries {
if let Some(query) = request.queries.first() {
lua.pushstring(&String::from_utf8_lossy(&query.name));
return 1;
}
} else if let &Some(ref response) = &tx.response {
for query in &response.queries {
if let Some(query) = response.queries.first() {
lua.pushstring(&String::from_utf8_lossy(&query.name));
return 1;
}

@ -34,7 +34,6 @@
#![allow(clippy::manual_find)]
#![allow(clippy::match_like_matches_macro)]
#![allow(clippy::module_inception)]
#![allow(clippy::never_loop)]
#![allow(clippy::new_without_default)]
#![allow(clippy::redundant_pattern_matching)]
#![allow(clippy::result_unit_err)]

Loading…
Cancel
Save