Skip to content

Commit 3dcad98

Browse files
committed
fix: To unstable feature
1 parent 81873ae commit 3dcad98

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/io/stderr.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use once_cell::sync::Lazy;
21
use std::io::Write as StdWrite;
32
use std::pin::Pin;
43
use std::sync::Mutex;
@@ -7,6 +6,10 @@ use crate::future::Future;
76
use crate::io::{self, Write};
87
use crate::task::{spawn_blocking, Context, JoinHandle, Poll};
98

9+
cfg_unstable! {
10+
use once_cell::sync::Lazy;
11+
}
12+
1013
/// Constructs a new handle to the standard error of the current process.
1114
///
1215
/// This function is an async version of [`std::io::stderr`].
@@ -119,6 +122,8 @@ impl Stderr {
119122
/// #
120123
/// # Ok(()) }) }
121124
/// ```
125+
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
126+
#[cfg(any(feature = "unstable", feature = "docs"))]
122127
pub async fn lock(&self) -> StderrLock<'static> {
123128
static STDERR: Lazy<std::io::Stderr> = Lazy::new(std::io::stderr);
124129

src/io/stdin.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
use once_cell::sync::Lazy;
21
use std::pin::Pin;
32
use std::sync::Mutex;
43

54
use crate::future::{self, Future};
65
use crate::io::{self, Read};
76
use crate::task::{spawn_blocking, Context, JoinHandle, Poll};
87

8+
cfg_unstable! {
9+
use once_cell::sync::Lazy;
10+
}
11+
912
/// Constructs a new handle to the standard input of the current process.
1013
///
1114
/// This function is an async version of [`std::io::stdin`].
@@ -175,6 +178,8 @@ impl Stdin {
175178
/// #
176179
/// # Ok(()) }) }
177180
/// ```
181+
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
182+
#[cfg(any(feature = "unstable", feature = "docs"))]
178183
pub async fn lock(&self) -> StdinLock<'static> {
179184
static STDIN: Lazy<std::io::Stdin> = Lazy::new(std::io::stdin);
180185

src/io/stdout.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use once_cell::sync::Lazy;
21
use std::io::Write as StdWrite;
32
use std::pin::Pin;
43
use std::sync::Mutex;
@@ -7,6 +6,10 @@ use crate::future::Future;
76
use crate::io::{self, Write};
87
use crate::task::{spawn_blocking, Context, JoinHandle, Poll};
98

9+
cfg_unstable! {
10+
use once_cell::sync::Lazy;
11+
}
12+
1013
/// Constructs a new handle to the standard output of the current process.
1114
///
1215
/// This function is an async version of [`std::io::stdout`].
@@ -119,6 +122,8 @@ impl Stdout {
119122
/// #
120123
/// # Ok(()) }) }
121124
/// ```
125+
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
126+
#[cfg(any(feature = "unstable", feature = "docs"))]
122127
pub async fn lock(&self) -> StdoutLock<'static> {
123128
static STDOUT: Lazy<std::io::Stdout> = Lazy::new(std::io::stdout);
124129

0 commit comments

Comments
 (0)