Skip to content

Commit 28d5f2c

Browse files
committed
chore: fix new clippy warnings
- `clippy::needless_lifetimes` in request.rs - `clippy::unnecessary-map-or` in vendored.rs
1 parent 85570e2 commit 28d5f2c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

nginx-sys/build/vendored.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ fn make_cache_dir() -> Result<PathBuf, Box<dyn StdError>> {
361361
fn download(cache_dir: &Path, url: &str) -> Result<PathBuf, Box<dyn StdError>> {
362362
fn proceed_with_download(file_path: &Path) -> bool {
363363
// File does not exist or is zero bytes
364-
!file_path.exists() || file_path.metadata().map_or(false, |m| m.len() < 1)
364+
!file_path.exists() || file_path.metadata().is_ok_and(|m| m.len() < 1)
365365
}
366366
let filename = url.split('/').last().unwrap();
367367
let file_path = cache_dir.join(filename);
@@ -544,7 +544,7 @@ fn compile_nginx(cache_dir: &Path) -> Result<(PathBuf, PathBuf), Box<dyn StdErro
544544
let build_info_path = nginx_src_dir.join("last-build-info");
545545
let current_build_info = build_info(&nginx_configure_flags);
546546
let build_info_no_change = if build_info_path.exists() {
547-
read_to_string(&build_info_path).map_or(false, |s| s == current_build_info)
547+
read_to_string(&build_info_path).is_ok_and(|s| s == current_build_info)
548548
} else {
549549
false
550550
};
@@ -599,7 +599,7 @@ fn nginx_configure_flags(
599599
modules
600600
};
601601
let mut nginx_opts = vec![format_source_path("--prefix", nginx_install_dir)];
602-
if env::var("NGX_DEBUG").map_or(false, |s| s == "true") {
602+
if env::var("NGX_DEBUG").is_ok_and(|s| s == "true") {
603603
println!("Enabling --with-debug");
604604
nginx_opts.push("--with-debug".to_string());
605605
}

src/http/request.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ impl<'a> PartialEq<&'a Method> for Method {
613613
}
614614
}
615615

616-
impl<'a> PartialEq<Method> for &'a Method {
616+
impl PartialEq<Method> for &Method {
617617
#[inline]
618618
fn eq(&self, other: &Method) -> bool {
619619
*self == other
@@ -641,7 +641,7 @@ impl<'a> PartialEq<&'a str> for Method {
641641
}
642642
}
643643

644-
impl<'a> PartialEq<Method> for &'a str {
644+
impl PartialEq<Method> for &str {
645645
#[inline]
646646
fn eq(&self, other: &Method) -> bool {
647647
*self == other.as_ref()

0 commit comments

Comments
 (0)