fix cleanliness for 1.65
This commit is contained in:
parent
ccd875bce4
commit
f7128a1a58
@ -32,6 +32,7 @@
|
||||
clippy::needless_doctest_main,
|
||||
clippy::single_component_path_imports,
|
||||
clippy::upper_case_acronyms, // can be removed on a major release boundary
|
||||
clippy::bool_to_int_with_if,
|
||||
)]
|
||||
#![recursion_limit = "1024"]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
@ -23,6 +23,7 @@
|
||||
#![allow(
|
||||
clippy::single_component_path_imports,
|
||||
clippy::upper_case_acronyms, // can be removed on a major release boundary
|
||||
clippy::bool_to_int_with_if,
|
||||
)]
|
||||
#![recursion_limit = "2048"]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
@ -402,6 +402,7 @@ mod mdns {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub(crate) enum Local {
|
||||
#[allow(dead_code)]
|
||||
ResolveStream(Pin<Box<dyn Stream<Item = Result<DnsResponse, ResolveError>> + Send>>),
|
||||
|
@ -90,7 +90,7 @@ fn into_resolver_config(
|
||||
// search
|
||||
let mut search = vec![];
|
||||
for search_domain in parsed_config.get_last_search_or_domain() {
|
||||
search.push(Name::from_str_relaxed(&search_domain).map_err(|e| {
|
||||
search.push(Name::from_str_relaxed(search_domain).map_err(|e| {
|
||||
io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
format!("Error parsing resolv.conf: {}", e),
|
||||
|
@ -280,7 +280,7 @@ fn load_key(zone_name: Name, key_config: &KeyConfig) -> Result<SigSigner, String
|
||||
let key: KeyPair<Private> = {
|
||||
info!("reading key: {:?}", key_path);
|
||||
|
||||
let mut file = File::open(&key_path)
|
||||
let mut file = File::open(key_path)
|
||||
.map_err(|e| format!("error opening private key file: {:?}: {}", key_path, e))?;
|
||||
|
||||
let mut key_bytes = Vec::with_capacity(256);
|
||||
|
@ -94,7 +94,7 @@ impl Journal {
|
||||
record)
|
||||
\
|
||||
VALUES ($1, $2, $3, $4)",
|
||||
&[
|
||||
[
|
||||
&client_id as &dyn ToSql,
|
||||
&soa_serial,
|
||||
×tamp,
|
||||
@ -150,23 +150,20 @@ impl Journal {
|
||||
)?;
|
||||
|
||||
let record_opt: Option<Result<(i64, Record), rusqlite::Error>> = stmt
|
||||
.query_and_then(
|
||||
&[&row_id],
|
||||
|row| -> Result<(i64, Record), rusqlite::Error> {
|
||||
let row_id: i64 = row.get(0)?;
|
||||
let record_bytes: Vec<u8> = row.get(1)?;
|
||||
let mut decoder = BinDecoder::new(&record_bytes);
|
||||
.query_and_then([&row_id], |row| -> Result<(i64, Record), rusqlite::Error> {
|
||||
let row_id: i64 = row.get(0)?;
|
||||
let record_bytes: Vec<u8> = row.get(1)?;
|
||||
let mut decoder = BinDecoder::new(&record_bytes);
|
||||
|
||||
// todo add location to this...
|
||||
match Record::read(&mut decoder) {
|
||||
Ok(record) => Ok((row_id, record)),
|
||||
Err(decode_error) => Err(rusqlite::Error::InvalidParameterName(format!(
|
||||
"could not decode: {}",
|
||||
decode_error
|
||||
))),
|
||||
}
|
||||
},
|
||||
)?
|
||||
// todo add location to this...
|
||||
match Record::read(&mut decoder) {
|
||||
Ok(record) => Ok((row_id, record)),
|
||||
Err(decode_error) => Err(rusqlite::Error::InvalidParameterName(format!(
|
||||
"could not decode: {}",
|
||||
decode_error
|
||||
))),
|
||||
}
|
||||
})?
|
||||
.next();
|
||||
|
||||
//
|
||||
@ -226,7 +223,7 @@ impl Journal {
|
||||
.conn
|
||||
.lock()
|
||||
.expect("conn poisoned")
|
||||
.execute("UPDATE tdns_schema SET version = $1", &[&new_version])?;
|
||||
.execute("UPDATE tdns_schema SET version = $1", [&new_version])?;
|
||||
|
||||
//
|
||||
assert_eq!(count, 1);
|
||||
|
@ -355,7 +355,7 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
print_result(lookup);
|
||||
} else {
|
||||
let duration = Duration::from_secs_f32(opts.interval);
|
||||
let fd = File::open(&opts.inputfile.as_ref().unwrap())?;
|
||||
let fd = File::open(opts.inputfile.as_ref().unwrap())?;
|
||||
let reader = BufReader::new(fd);
|
||||
let mut taskset = JoinSet::new();
|
||||
let mut timer = tokio::time::interval(duration);
|
||||
|
Loading…
Reference in New Issue
Block a user