From 21781761f34da68b6c38ff8951f8a7cd1c2f7a8c Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 18 Jun 2025 16:44:22 -0700 Subject: [PATCH] feat!: bump supported Rust version to 1.81.0 --- Cargo.toml | 3 +-- src/http/module.rs | 4 ++-- src/http/request.rs | 4 ++-- src/http/status.rs | 5 ++--- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d46cb3d9..014cff92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "Apache-2.0" homepage = "https://github.com/nginx/ngx-rust" repository = "https://github.com/nginx/ngx-rust" -rust-version = "1.79.0" +rust-version = "1.81.0" [package] name = "ngx" @@ -33,7 +33,6 @@ default = ["vendored","std"] # If no `std` flag, `alloc` crate is internally used instead. This flag is mainly for `no_std` build. alloc = [] # Enables the components using `std` crate. -# Currently the only difference to `alloc` flag is `std::error::Error` implementation. std = ["alloc"] # Build our own copy of the NGINX by default. # This could be disabled with `--no-default-features` to minimize the dependency diff --git a/src/http/module.rs b/src/http/module.rs index 657a9730..ef289c20 100644 --- a/src/http/module.rs +++ b/src/http/module.rs @@ -1,3 +1,4 @@ +use core::error; use core::ffi::{c_char, c_void}; use core::fmt; use core::ptr; @@ -13,8 +14,7 @@ pub enum MergeConfigError { NoValue, } -#[cfg(feature = "std")] -impl std::error::Error for MergeConfigError {} +impl error::Error for MergeConfigError {} impl fmt::Display for MergeConfigError { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/http/request.rs b/src/http/request.rs index d17d294c..f8dead2b 100644 --- a/src/http/request.rs +++ b/src/http/request.rs @@ -1,3 +1,4 @@ +use core::error; use core::ffi::c_void; use core::fmt; use core::ptr::NonNull; @@ -711,8 +712,7 @@ impl fmt::Display for InvalidMethod { } } -#[cfg(feature = "std")] -impl std::error::Error for InvalidMethod {} +impl error::Error for InvalidMethod {} #[derive(Clone, PartialEq, Eq, Hash)] enum MethodInner { diff --git a/src/http/status.rs b/src/http/status.rs index ec77a924..8b067cb6 100644 --- a/src/http/status.rs +++ b/src/http/status.rs @@ -1,4 +1,4 @@ -use core::fmt; +use core::{error, fmt}; use crate::core::Status; use crate::ffi::*; @@ -28,8 +28,7 @@ impl fmt::Display for InvalidHTTPStatusCode { } } -#[cfg(feature = "std")] -impl std::error::Error for InvalidHTTPStatusCode {} +impl error::Error for InvalidHTTPStatusCode {} impl From for Status { fn from(val: HTTPStatus) -> Self {