diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs index 935155c..e94ce0c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,28 +1,26 @@ #![forbid(unsafe_code)] -use crate::prelude::*; - use crate::result::Result; use crate::terminal::{Input, Terminal}; -use async_std::io; use std::collections::HashMap; use std::collections::HashSet; use std::env; use std::os::unix::fs::PermissionsExt; use std::process::{self, Command}; +use tokio::io::{self, AsyncWriteExt}; #[macro_use] extern crate lalrpop_util; lalrpop_mod!(pub commandline); pub mod error; pub mod path; -pub mod prelude; pub mod result; pub mod terminal; -fn main() -> Result<()> { - let result = async_std::task::block_on(async { repl().await }); +#[tokio::main] +async fn main() -> Result<()> { + let result = repl().await; process::exit(match result { Ok(()) => 0, Err(ref e) => { @@ -61,8 +59,9 @@ async fn repl() -> Result<()> { async fn prompt() -> Result<()> { - print!("\n$ "); - io::stdout().flush().await?; + let mut stdout = io::stdout(); + stdout.write_all("\n$ ".as_bytes()).await?; + stdout.flush().await?; Ok(()) } |