Skip to content

Commit 5ecb7a8

Browse files
committed
refactor: minimize cfg needed for no_std, alloc, std features
1 parent 1f4b572 commit 5ecb7a8

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

src/async_/spawn.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1+
use alloc::collections::vec_deque::VecDeque;
12
use core::cell::UnsafeCell;
23
use core::future::Future;
34
use core::mem;
45
use core::ptr::{self, NonNull};
56

6-
#[cfg(all(not(feature = "std"), feature = "alloc"))]
7-
use alloc::collections::vec_deque::VecDeque;
8-
#[cfg(feature = "std")]
9-
use std::collections::vec_deque::VecDeque;
10-
117
pub use async_task::Task;
128
use async_task::{Runnable, ScheduleInfo, WithInfo};
139
use nginx_sys::{

src/core/string.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
#[cfg(all(not(feature = "std"), feature = "alloc"))]
2-
use alloc::{borrow::Cow, string::String};
31
use core::cmp;
42
use core::fmt;
53
use core::str::{self, Utf8Error};
6-
#[cfg(feature = "std")]
7-
use std::{borrow::Cow, string::String};
4+
5+
#[cfg(feature = "alloc")]
6+
use alloc::{borrow::Cow, string::String};
87

98
use crate::ffi::{ngx_str_t, u_char};
109

src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,9 @@
117117
//! brew install --with-toolchain llvm
118118
//! ```
119119
#![warn(missing_docs)]
120-
// support both std and no_std
121120
#![no_std]
122-
#[cfg(all(not(feature = "std"), feature = "alloc"))]
121+
#[cfg(feature = "alloc")]
123122
extern crate alloc;
124-
#[cfg(feature = "std")]
125-
extern crate std;
126123

127124
pub mod allocator;
128125
#[cfg(feature = "async")]

0 commit comments

Comments
 (0)