Skip to content

Commit 89cf0e0

Browse files
JyJyJcrbavshin-f5
authored andcommitted
chore: add Cargo features
1 parent 61a8cde commit 89cf0e0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,16 @@ repository.workspace = true
2525
rust-version.workspace = true
2626

2727
[dependencies]
28-
nginx-sys = { path = "nginx-sys", version = "0.5.0"}
28+
nginx-sys = { path = "nginx-sys", default-features=false, version = "0.5.0"}
2929

3030
[features]
31-
default = ["vendored"]
31+
default = ["vendored","std"]
32+
# Enables the components using memory allocation.
33+
# If no `std` flag, `alloc` crate is internally used instead. This flag is mainly for `no_std` build.
34+
alloc = []
35+
# Enables the components using `std` crate.
36+
# Currently the only difference to `alloc` flag is `std::error::Error` implementation.
37+
std = ["alloc"]
3238
# Build our own copy of the NGINX by default.
3339
# This could be disabled with `--no-default-features` to minimize the dependency tree
3440
# when building against an existing copy of the NGINX with the NGX_OBJS variable.

examples/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build = "../build.rs"
1212

1313
[dependencies]
1414
nginx-sys = { path = "../nginx-sys/", default-features = false }
15-
ngx = { path = "../", default-features = false }
15+
ngx = { path = "../", default-features = false, features = ["std"] }
1616

1717
[dev-dependencies]
1818
aws-sign-v4 = "0.3.0"

0 commit comments

Comments
 (0)