async_std/io/stdio.rs
1//! Internal types for stdio.
2//!
3//! This module is a port of `libstd/io/stdio.rs`,and contains internal types for `print`/`eprint`.
4
5use crate::io::{stderr, stdout};
6use crate::prelude::*;
7use std::fmt;
8
9#[doc(hidden)]
10pub async fn _print(args: fmt::Arguments<'_>) {
11 if let Err(e) = stdout().write_fmt(args).await {
12 panic!("failed printing to stdout: {}", e);
13 }
14}
15
16#[doc(hidden)]
17pub async fn _eprint(args: fmt::Arguments<'_>) {
18 if let Err(e) = stderr().write_fmt(args).await {
19 panic!("failed printing to stderr: {}", e);
20 }
21}