From 6eeec89032c7bd72d95e0c7db38a21daba2c50fe Mon Sep 17 00:00:00 2001 From: Julian Eager Date: Thu, 21 Dec 2023 14:34:19 +0800 Subject: [PATCH] just use core/alloc --- latches/src/futex/mod.rs | 10 ---------- latches/src/sync/mod.rs | 14 +++----------- latches/src/task/mod.rs | 14 -------------- 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/latches/src/futex/mod.rs b/latches/src/futex/mod.rs index beed522..8c83d95 100644 --- a/latches/src/futex/mod.rs +++ b/latches/src/futex/mod.rs @@ -1,13 +1,3 @@ -#[cfg(feature = "std")] -use std::{ - fmt, hint, - sync::atomic::{ - AtomicU32, - Ordering::{Acquire, Relaxed, Release}, - }, -}; - -#[cfg(not(feature = "std"))] use core::{ fmt, hint, sync::atomic::{ diff --git a/latches/src/sync/mod.rs b/latches/src/sync/mod.rs index c4030db..fb127ef 100644 --- a/latches/src/sync/mod.rs +++ b/latches/src/sync/mod.rs @@ -1,14 +1,3 @@ -#[cfg(feature = "std")] -use std::{ - fmt, hint, - sync::atomic::{ - AtomicUsize, - Ordering::{Acquire, Relaxed, Release}, - }, - time::{Duration, Instant}, -}; - -#[cfg(not(feature = "std"))] use core::{ fmt, hint, sync::atomic::{ @@ -17,6 +6,9 @@ use core::{ }, }; +#[cfg(feature = "std")] +use std::time::{Duration, Instant}; + #[cfg(all(not(feature = "std"), not(feature = "atomic-wait")))] compile_error!("`sync` requires `std` or `atomic-wait` feature for Condvar"); diff --git a/latches/src/task/mod.rs b/latches/src/task/mod.rs index 6abd342..bacc478 100644 --- a/latches/src/task/mod.rs +++ b/latches/src/task/mod.rs @@ -1,17 +1,3 @@ -#[cfg(feature = "std")] -use std::{ - fmt, - future::Future, - hint, - pin::Pin, - sync::atomic::{ - AtomicUsize, - Ordering::{Acquire, Relaxed, Release}, - }, - task::{Context, Poll}, -}; - -#[cfg(not(feature = "std"))] use core::{ fmt, future::Future,