diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index e7a11a9..f1fce9f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,16 @@ +use async_std::io::WriteExt as _; + +async fn async_main() -> anyhow::Result<()> { + async_std::io::stdout().write_all(b"hello world\n").await?; + Ok(()) +} + fn main() { - println!("Hello, world!"); + match async_std::task::block_on(async_main()) { + Ok(_) => (), + Err(e) => { + eprintln!("nbsh: {}", e); + std::process::exit(1); + } + }; } |