Skip to content

chore: address compiler warnings on nightly #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() {
println!("cargo::rerun-if-env-changed=DEP_NGINX_FEATURES");
if let Ok(features) = std::env::var("DEP_NGINX_FEATURES") {
for feature in features.split(',').map(str::trim) {
println!("cargo::rustc-cfg=ngx_feature=\"{}\"", feature);
println!("cargo::rustc-cfg=ngx_feature=\"{feature}\"");
}
}

Expand All @@ -30,7 +30,7 @@ fn main() {
// Read operating system detected by nginx-sys and pass to the compiler.
println!("cargo::rerun-if-env-changed=DEP_NGINX_OS");
if let Ok(os) = std::env::var("DEP_NGINX_OS") {
println!("cargo::rustc-cfg=ngx_os=\"{}\"", os);
println!("cargo::rustc-cfg=ngx_os=\"{os}\"");
}

// Generate cfg values for version checks
Expand Down
34 changes: 13 additions & 21 deletions nginx-sys/build/vendored.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,9 @@ fn download(cache_dir: &Path, url: &str) -> Result<PathBuf, Box<dyn StdError>> {
}

if !file_path.exists() {
return Err(format!(
"Downloaded file was not written to the expected location: {}",
url
)
.into());
return Err(
format!("Downloaded file was not written to the expected location: {url}",).into(),
);
}
Ok(file_path)
}
Expand All @@ -425,14 +423,11 @@ fn verify_signature_file(cache_dir: &Path, signature_path: &Path) -> Result<(),

if !output.status.success() {
eprintln!("{}", String::from_utf8_lossy(&output.stdout));
return Err(Box::new(std::io::Error::new(
std::io::ErrorKind::Other,
format!(
"Command: {:?} \nGPG signature file verification failed for signature: {}",
cmd,
signature_path.display()
),
)));
return Err(Box::new(std::io::Error::other(format!(
"Command: {:?} \nGPG signature file verification failed for signature: {}",
cmd,
signature_path.display()
))));
}
} else {
println!("GPG not found, skipping signature file verification");
Expand Down Expand Up @@ -460,14 +455,11 @@ fn verify_archive_signature(
let output = cmd.stderr_to_stdout().stdout_capture().unchecked().run()?;
if !output.status.success() {
eprintln!("{}", String::from_utf8_lossy(&output.stdout));
return Err(Box::new(std::io::Error::new(
std::io::ErrorKind::Other,
format!(
"Command: {:?}\nGPG signature verification failed of archive failed [{}]",
cmd,
archive_path.display()
),
)));
return Err(Box::new(std::io::Error::other(format!(
"Command: {:?}\nGPG signature verification failed of archive failed [{}]",
cmd,
archive_path.display()
))));
}
} else {
println!("GPG not found, skipping signature verification");
Expand Down
2 changes: 2 additions & 0 deletions nginx-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use core::slice;

#[doc(hidden)]
mod bindings {
#![allow(unknown_lints)] // unnecessary_transmutes
#![allow(missing_docs)]
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
Expand All @@ -20,6 +21,7 @@ mod bindings {
#![allow(clippy::all)]
#![allow(improper_ctypes)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(unnecessary_transmutes)]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
}
#[doc(no_inline)]
Expand Down
4 changes: 2 additions & 2 deletions nginx-sys/src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub unsafe fn ngx_queue_init(q: *mut ngx_queue_t) {
/// `q` must be a valid pointer to [ngx_queue_t], initialized with [ngx_queue_init].
#[inline]
pub unsafe fn ngx_queue_empty(q: *const ngx_queue_t) -> bool {
q == (*q).prev
ptr::eq(q, (*q).prev)
}

/// Inserts a new node after the current.
Expand Down Expand Up @@ -190,7 +190,7 @@ mod tests {
type Item = *mut ngx_queue_t;

fn next(&mut self) -> Option<Self::Item> {
if self.h == self.q {
if ptr::eq(self.h, self.q) {
return None;
}

Expand Down
Loading