Use BufWriter instead of File
This commit is contained in:
parent
2e2fdb200d
commit
c5aca50582
@ -1,3 +1,4 @@
|
|||||||
|
cargo-features = ["strip"]
|
||||||
[package]
|
[package]
|
||||||
name = "kakutils-rs"
|
name = "kakutils-rs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@ -20,7 +20,7 @@ use std::{
|
|||||||
convert::Into,
|
convert::Into,
|
||||||
env, fs,
|
env, fs,
|
||||||
fs::{File, OpenOptions},
|
fs::{File, OpenOptions},
|
||||||
io::Write,
|
io::{BufWriter, Write},
|
||||||
str::FromStr,
|
str::FromStr,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -183,11 +183,12 @@ pub fn kak_response(msg: &str) -> Result<Vec<String>, KakMessage> {
|
|||||||
Ok(selections)
|
Ok(selections)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn open_command_fifo() -> Result<File, KakMessage> {
|
pub fn open_command_fifo() -> Result<BufWriter<File>, KakMessage> {
|
||||||
OpenOptions::new()
|
OpenOptions::new()
|
||||||
.write(true)
|
.write(true)
|
||||||
.append(true)
|
.append(true)
|
||||||
.open(&get_var("kak_command_fifo")?)
|
.open(&get_var("kak_command_fifo")?)
|
||||||
|
.map(BufWriter::new)
|
||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user