improv(plugins): crate::send shall use write_all instead of write

This commit is contained in:
Michael Aaron Murphy 2021-08-18 14:01:25 +02:00
parent 4a45257472
commit 878e31f30c

View file

@ -13,8 +13,7 @@ use std::ffi::OsStr;
pub async fn send<W: AsyncWrite + Unpin>(tx: &mut W, response: PluginResponse) {
if let Ok(mut bytes) = serde_json::to_string(&response) {
bytes.push('\n');
let _ = tx.write(bytes.as_bytes()).await;
let _ = tx.flush().await;
let _ = tx.write_all(bytes.as_bytes()).await;
}
}