Replaced std::io::prelude with Write trait

This commit is contained in:
Metrowai 2023-05-16 21:31:29 -07:00
parent 4904842e96
commit 3c3959f7e4

View file

@ -1,8 +1,7 @@
use blocking::unblock;
use dialoguer::{theme::ColorfulTheme, Confirm, Input, MultiSelect, Select};
use mlua::prelude::*;
use std::io;
use std::io::prelude::*;
use std::io::Write;
use crate::lua::{
stdio::{
@ -29,12 +28,12 @@ pub fn create(lua: &'static Lua) -> LuaResult<LuaTable> {
})?
.with_function("write", |_, s: String| {
print!("{s}");
io::stdout().flush().expect("Could not flush stdout");
std::io::stdout().flush().expect("Could not flush stdout");
Ok(())
})?
.with_function("ewrite", |_, s: String| {
eprint!("{s}");
io::stderr().flush().expect("Could not flush stderr");
std::io::stderr().flush().expect("Could not flush stderr");
Ok(())
})?
.with_async_function("prompt", |_, options: PromptOptions| {