Skip to content

Commit b4fc5ca

Browse files
committed
feat: to no_std future::pending
1 parent 3e24e0b commit b4fc5ca

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/future/pending.rs

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use std::future::Future;
2-
use std::marker::PhantomData;
3-
use std::pin::Pin;
1+
use core::future::Future;
2+
use core::marker::PhantomData;
3+
use core::pin::Pin;
44

55
use crate::task::{Context, Poll};
66

@@ -24,14 +24,17 @@ use crate::task::{Context, Poll};
2424
/// #
2525
/// # })
2626
/// ```
27-
pub async fn pending<T>() -> T {
28-
let fut = Pending {
27+
pub fn pending<T>() -> Pending<T> {
28+
Pending {
2929
_marker: PhantomData,
30-
};
31-
fut.await
30+
}
3231
}
3332

34-
struct Pending<T> {
33+
/// This future is constructed by the [`pending`] function.
34+
///
35+
/// [`pending`]: fn.pending.html
36+
#[derive(Debug)]
37+
pub struct Pending<T> {
3538
_marker: PhantomData<T>,
3639
}
3740

0 commit comments

Comments
 (0)