Skip to content

Commit be60dd9

Browse files
committed
fix: Remove unnecessary re-export and macros
1 parent 23b7c17 commit be60dd9

File tree

4 files changed

+2
-176
lines changed

4 files changed

+2
-176
lines changed

Diff for: src/future/into_future.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ use std::future::Future;
55
/// # Examples
66
///
77
/// ```
8+
/// use std::pin::Pin;
9+
///
810
/// use async_std::future::{Future, IntoFuture};
911
/// use async_std::io;
10-
/// use async_std::pin::Pin;
1112
///
1213
/// struct Client;
1314
///

Diff for: src/io/mod.rs

-4
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,6 @@ cfg_std! {
305305
}
306306

307307
cfg_default! {
308-
// For use in the print macros.
309-
#[doc(hidden)]
310-
pub use stdio::{_eprint, _print};
311-
312308
pub use stderr::{stderr, Stderr, StderrLock};
313309
pub use stdin::{stdin, Stdin, StdinLock};
314310
pub use stdout::{stdout, Stdout, StdoutLock};

Diff for: src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,6 @@ cfg_default! {
273273
}
274274

275275
cfg_unstable! {
276-
pub mod pin;
277-
pub mod process;
278-
279276
mod unit;
280277
mod vec;
281278
mod result;

Diff for: src/macros.rs

-168
Original file line numberDiff line numberDiff line change
@@ -1,171 +1,3 @@
1-
/// Prints to the standard output.
2-
///
3-
/// Equivalent to the [`println!`] macro except that a newline is not printed at
4-
/// the end of the message.
5-
///
6-
/// Note that stdout is frequently line-buffered by default so it may be
7-
/// necessary to use [`io::stdout().flush()`][flush] to ensure the output is emitted
8-
/// immediately.
9-
///
10-
/// Use `print!` only for the primary output of your program. Use
11-
/// [`eprint!`] instead to print error and progress messages.
12-
///
13-
/// [`println!`]: macro.println.html
14-
/// [flush]: io/trait.Write.html#tymethod.flush
15-
/// [`eprint!`]: macro.eprint.html
16-
///
17-
/// # Panics
18-
///
19-
/// Panics if writing to `io::stdout()` fails.
20-
///
21-
/// # Examples
22-
///
23-
/// ```
24-
/// # async_std::task::block_on(async {
25-
/// #
26-
/// use async_std::io;
27-
/// use async_std::prelude::*;
28-
/// use async_std::print;
29-
///
30-
/// print!("this ").await;
31-
/// print!("will ").await;
32-
/// print!("be ").await;
33-
/// print!("on ").await;
34-
/// print!("the ").await;
35-
/// print!("same ").await;
36-
/// print!("line ").await;
37-
///
38-
/// io::stdout().flush().await.unwrap();
39-
///
40-
/// print!("this string has a newline, why not choose println! instead?\n").await;
41-
///
42-
/// io::stdout().flush().await.unwrap();
43-
/// #
44-
/// # })
45-
/// ```
46-
#[cfg(feature = "unstable")]
47-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
48-
#[macro_export]
49-
macro_rules! print {
50-
($($arg:tt)*) => ($crate::io::_print(format_args!($($arg)*)))
51-
}
52-
53-
/// Prints to the standard output, with a newline.
54-
///
55-
/// On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`) alone
56-
/// (no additional CARRIAGE RETURN (`\r`/`U+000D`)).
57-
///
58-
/// Use the [`format!`] syntax to write data to the standard output.
59-
/// See [`std::fmt`] for more information.
60-
///
61-
/// Use `println!` only for the primary output of your program. Use
62-
/// [`eprintln!`] instead to print error and progress messages.
63-
///
64-
/// [`format!`]: macro.format.html
65-
/// [`std::fmt`]: https://doc.rust-lang.org/std/fmt/index.html
66-
/// [`eprintln!`]: macro.eprintln.html
67-
/// # Panics
68-
///
69-
/// Panics if writing to `io::stdout` fails.
70-
///
71-
/// # Examples
72-
///
73-
/// ```
74-
/// # async_std::task::block_on(async {
75-
/// #
76-
/// use async_std::println;
77-
///
78-
/// println!().await; // prints just a newline
79-
/// println!("hello there!").await;
80-
/// println!("format {} arguments", "some").await;
81-
/// #
82-
/// # })
83-
/// ```
84-
#[cfg(feature = "unstable")]
85-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
86-
#[macro_export]
87-
macro_rules! println {
88-
() => ($crate::print!("\n"));
89-
($($arg:tt)*) => (async {
90-
$crate::io::_print(format_args!($($arg)*)).await;
91-
$crate::io::_print(format_args!("\n")).await;
92-
})
93-
}
94-
95-
/// Prints to the standard error.
96-
///
97-
/// Equivalent to the [`print!`] macro, except that output goes to
98-
/// [`io::stderr`] instead of `io::stdout`. See [`print!`] for
99-
/// example usage.
100-
///
101-
/// Use `eprint!` only for error and progress messages. Use `print!`
102-
/// instead for the primary output of your program.
103-
///
104-
/// [`io::stderr`]: io/struct.Stderr.html
105-
/// [`print!`]: macro.print.html
106-
///
107-
/// # Panics
108-
///
109-
/// Panics if writing to `io::stderr` fails.
110-
///
111-
/// # Examples
112-
///
113-
/// ```
114-
/// # async_std::task::block_on(async {
115-
/// #
116-
/// use async_std::eprint;
117-
///
118-
/// eprint!("Error: Could not complete task").await;
119-
/// #
120-
/// # })
121-
/// ```
122-
#[cfg(feature = "unstable")]
123-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
124-
#[macro_export]
125-
macro_rules! eprint {
126-
($($arg:tt)*) => ($crate::io::_eprint(format_args!($($arg)*)))
127-
}
128-
129-
/// Prints to the standard error, with a newline.
130-
///
131-
/// Equivalent to the [`println!`] macro, except that output goes to
132-
/// [`io::stderr`] instead of `io::stdout`. See [`println!`] for
133-
/// example usage.
134-
///
135-
/// Use `eprintln!` only for error and progress messages. Use `println!`
136-
/// instead for the primary output of your program.
137-
///
138-
/// [`io::stderr`]: io/struct.Stderr.html
139-
/// [`println!`]: macro.println.html
140-
///
141-
/// # Panics
142-
///
143-
/// Panics if writing to `io::stderr` fails.
144-
///
145-
/// # Examples
146-
///
147-
/// ```
148-
/// # async_std::task::block_on(async {
149-
/// #
150-
/// use async_std::eprintln;
151-
///
152-
/// eprintln!("Error: Could not complete task").await;
153-
/// #
154-
/// # })
155-
/// ```
156-
#[cfg(feature = "unstable")]
157-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
158-
#[macro_export]
159-
macro_rules! eprintln {
160-
() => (async { $crate::eprint!("\n").await; });
161-
($($arg:tt)*) => (
162-
async {
163-
$crate::io::_eprint(format_args!($($arg)*)).await;
164-
$crate::io::_eprint(format_args!("\n")).await;
165-
}
166-
);
167-
}
168-
1691
/// Declares task-local values.
1702
///
1713
/// The macro wraps any number of static declarations and makes them task-local. Attributes and

0 commit comments

Comments
 (0)