fix: To unstable feature

pull/334/head
k-nasa 5 years ago
parent 81873ae5f3
commit 3dcad984b4

@ -1,4 +1,3 @@
use once_cell::sync::Lazy;
use std::io::Write as StdWrite;
use std::pin::Pin;
use std::sync::Mutex;
@ -7,6 +6,10 @@ use crate::future::Future;
use crate::io::{self, Write};
use crate::task::{spawn_blocking, Context, JoinHandle, Poll};
cfg_unstable! {
use once_cell::sync::Lazy;
}
/// Constructs a new handle to the standard error of the current process.
///
/// This function is an async version of [`std::io::stderr`].
@ -119,6 +122,8 @@ impl Stderr {
/// #
/// # Ok(()) }) }
/// ```
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[cfg(any(feature = "unstable", feature = "docs"))]
pub async fn lock(&self) -> StderrLock<'static> {
static STDERR: Lazy<std::io::Stderr> = Lazy::new(std::io::stderr);

@ -1,4 +1,3 @@
use once_cell::sync::Lazy;
use std::pin::Pin;
use std::sync::Mutex;
@ -6,6 +5,10 @@ use crate::future::{self, Future};
use crate::io::{self, Read};
use crate::task::{spawn_blocking, Context, JoinHandle, Poll};
cfg_unstable! {
use once_cell::sync::Lazy;
}
/// Constructs a new handle to the standard input of the current process.
///
/// This function is an async version of [`std::io::stdin`].
@ -175,6 +178,8 @@ impl Stdin {
/// #
/// # Ok(()) }) }
/// ```
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[cfg(any(feature = "unstable", feature = "docs"))]
pub async fn lock(&self) -> StdinLock<'static> {
static STDIN: Lazy<std::io::Stdin> = Lazy::new(std::io::stdin);

@ -1,4 +1,3 @@
use once_cell::sync::Lazy;
use std::io::Write as StdWrite;
use std::pin::Pin;
use std::sync::Mutex;
@ -7,6 +6,10 @@ use crate::future::Future;
use crate::io::{self, Write};
use crate::task::{spawn_blocking, Context, JoinHandle, Poll};
cfg_unstable! {
use once_cell::sync::Lazy;
}
/// Constructs a new handle to the standard output of the current process.
///
/// This function is an async version of [`std::io::stdout`].
@ -119,6 +122,8 @@ impl Stdout {
/// #
/// # Ok(()) }) }
/// ```
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[cfg(any(feature = "unstable", feature = "docs"))]
pub async fn lock(&self) -> StdoutLock<'static> {
static STDOUT: Lazy<std::io::Stdout> = Lazy::new(std::io::stdout);

Loading…
Cancel
Save