Skip to content

Commit 5c7f978

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

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

src/async_/spawn.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ use core::future::Future;
33
use core::mem;
44
use core::ptr::{self, NonNull};
55

6-
#[cfg(all(not(feature = "std"), feature = "alloc"))]
76
use alloc::collections::vec_deque::VecDeque;
8-
#[cfg(feature = "std")]
9-
use std::collections::vec_deque::VecDeque;
107

118
pub use async_task::Task;
129
use async_task::{Runnable, ScheduleInfo, WithInfo};

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: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,8 @@
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"))]
123121
extern crate alloc;
124-
#[cfg(feature = "std")]
125-
extern crate std;
126122

127123
pub mod allocator;
128124
#[cfg(feature = "async")]

0 commit comments

Comments
 (0)