Skip to content

Commit 6ff537e

Browse files
committed
feat!: bump supported Rust version to 1.81.0
1 parent 98cf6fb commit 6ff537e

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ edition = "2021"
99
license = "Apache-2.0"
1010
homepage = "https://github.com/nginx/ngx-rust"
1111
repository = "https://github.com/nginx/ngx-rust"
12-
rust-version = "1.79.0"
12+
rust-version = "1.81.0"
1313

1414
[package]
1515
name = "ngx"
@@ -33,7 +33,6 @@ default = ["vendored","std"]
3333
# If no `std` flag, `alloc` crate is internally used instead. This flag is mainly for `no_std` build.
3434
alloc = []
3535
# Enables the components using `std` crate.
36-
# Currently the only difference to `alloc` flag is `std::error::Error` implementation.
3736
std = ["alloc"]
3837
# Build our own copy of the NGINX by default.
3938
# This could be disabled with `--no-default-features` to minimize the dependency

src/http/module.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use core::error;
12
use core::ffi::{c_char, c_void};
23
use core::fmt;
34
use core::ptr;
@@ -13,8 +14,7 @@ pub enum MergeConfigError {
1314
NoValue,
1415
}
1516

16-
#[cfg(feature = "std")]
17-
impl std::error::Error for MergeConfigError {}
17+
impl error::Error for MergeConfigError {}
1818

1919
impl fmt::Display for MergeConfigError {
2020
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {

src/http/request.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use core::error;
12
use core::ffi::c_void;
23
use core::fmt;
34
use core::ptr::NonNull;
@@ -711,8 +712,7 @@ impl fmt::Display for InvalidMethod {
711712
}
712713
}
713714

714-
#[cfg(feature = "std")]
715-
impl std::error::Error for InvalidMethod {}
715+
impl error::Error for InvalidMethod {}
716716

717717
#[derive(Clone, PartialEq, Eq, Hash)]
718718
enum MethodInner {

src/http/status.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use core::fmt;
1+
use core::{error, fmt};
22

33
use crate::core::Status;
44
use crate::ffi::*;
@@ -28,8 +28,7 @@ impl fmt::Display for InvalidHTTPStatusCode {
2828
}
2929
}
3030

31-
#[cfg(feature = "std")]
32-
impl std::error::Error for InvalidHTTPStatusCode {}
31+
impl error::Error for InvalidHTTPStatusCode {}
3332

3433
impl From<HTTPStatus> for Status {
3534
fn from(val: HTTPStatus) -> Self {

0 commit comments

Comments
 (0)