8000 Some functions in future module to no_std by k-nasa · Pull Request #696 · async-rs/async-std · GitHub
[go: up one dir, main page]

Skip to content

Some functions in future module to no_std #696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: to no_std future::pending
  • Loading branch information
k-nasa committed Feb 4, 2020
commit da23d16019f4cf926349d9b45a2a6541db77733e
19 changes: 11 additions & 8 deletions src/future/pending.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::future::Future;
use std::marker::PhantomData;
use std::pin::Pin;
use core::future::Future;
use core::marker::PhantomData;
use core::pin::Pin;

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

Expand All @@ -24,14 +24,17 @@ use crate::task::{Context, Poll};
/// #
/// # })
/// ```
pub async fn pending<T>() -> T {
let fut = Pending {
pub fn pending<T>() -> Pending<T> {
Pending {
_marker: PhantomData,
};
fut.await
}
}

struct Pending<T> {
/// This future is constructed by the [`pending`] function.
///
/// [`pending`]: fn.pending.html
#[derive(Debug)]
pub struct Pending<T> {
_marker: PhantomData<T>,
}

Expand Down
0