Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit da23d16

Browse files
committed
feat: to no_std future::pending
1 parent 125fa5b commit da23d16

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

‎src/future/pending.rs‎

Lines changed: 11 additions & 8 deletions
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 asyncfn 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)

AltStyle によって変換されたページ (->オリジナル) /