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 | |
5 | use crate::io::{stderr, stdout}; |
6 | use crate::prelude::*; |
7 | use std::fmt; |
8 | |
9 | #[doc (hidden)] |
10 | pub async fn _print(args: fmt::Arguments<'_>) { |
11 | if let Err(e: Error) = stdout().write_fmt(args).await { |
12 | panic!("failed printing to stdout: {}" , e); |
13 | } |
14 | } |
15 | |
16 | #[doc (hidden)] |
17 | pub async fn _eprint(args: fmt::Arguments<'_>) { |
18 | if let Err(e: Error) = stderr().write_fmt(args).await { |
19 | panic!("failed printing to stderr: {}" , e); |
20 | } |
21 | } |
22 | |