solana_cli_output/stdout.rs
1use std::{
2 fmt,
3 io::{self, Write},
4};
5
6pub fn write_stdout(args: fmt::Arguments<'_>) -> io::Result<()> {
7 io::stdout().lock().write_fmt(args)
8}
9
10pub fn write_stdout_str(s: &str) -> io::Result<()> {
11 io::stdout().lock().write_all(s.as_bytes())
12}
13
14pub fn writeln_stdout(args: fmt::Arguments<'_>) -> io::Result<()> {
15 let mut stdout = io::stdout().lock();
16 stdout.write_fmt(args)?;
17 stdout.write_all(b"\n")
18}