Skip to content
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
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/http/module.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use core::error;
use core::ffi::{c_char, c_void};
use core::fmt;
use core::ptr;
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/http/request.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use core::error;
use core::ffi::c_void;
use core::fmt;
use core::ptr::NonNull;
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions src/http/status.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use core::fmt;
use core::{error, fmt};

use crate::core::Status;
use crate::ffi::*;
Expand Down Expand Up @@ -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<HTTPStatus> for Status {
fn from(val: HTTPStatus) -> Self {
Expand Down
Loading