Fix / silence clippy lints

This commit is contained in:
Jonas Platte 2021-12-09 15:50:42 +01:00
parent 7ebe660402
commit 7e3b727d04
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
2 changed files with 2 additions and 3 deletions

View File

@ -1,7 +1,5 @@
use crate::error::Error; use crate::error::Error;
// Clippy lint is buggy, should be fixed within the next week (as of 2021-10-29)
#[allow(clippy::question_mark)]
pub fn validate(server_name: &str) -> Result<(), Error> { pub fn validate(server_name: &str) -> Result<(), Error> {
use std::net::Ipv6Addr; use std::net::Ipv6Addr;
@ -21,6 +19,7 @@ pub fn validate(server_name: &str) -> Result<(), Error> {
end_of_ipv6 + 1 end_of_ipv6 + 1
} else { } else {
#[allow(clippy::unnecessary_lazy_evaluations)]
let end_of_host = server_name.find(':').unwrap_or_else(|| server_name.len()); let end_of_host = server_name.find(':').unwrap_or_else(|| server_name.len());
if server_name[..end_of_host] if server_name[..end_of_host]

View File

@ -1095,7 +1095,7 @@ mod tests {
vec!["o", "l", "n", "m", "p"], vec!["o", "l", "n", "m", "p"],
res.iter() res.iter()
.map(ToString::to_string) .map(ToString::to_string)
.map(|s| s.replace("$", "").replace(":foo", "")) .map(|s| s.replace('$', "").replace(":foo", ""))
.collect::<Vec<_>>() .collect::<Vec<_>>()
) )
} }