Remove unneccesary send_reply

This commit is contained in:
Ryze 2023-03-14 22:10:51 +03:00
parent 43c3cae634
commit 76e8c0d8f2
Signed by: ryze
GPG key ID: 9B296C5CEAEAAAC1

View file

@ -10,10 +10,6 @@ pub struct FF2MpvMessage {
pub url: String, pub url: String,
} }
pub fn send_reply() -> Result<(), io::Error> {
send_message("ok")
}
pub fn get_mpv_message() -> Result<FF2MpvMessage, FF2MpvError> { pub fn get_mpv_message() -> Result<FF2MpvMessage, FF2MpvError> {
let message = read_message()?; let message = read_message()?;
let ff2mpv_message = serde_json::from_str(&message)?; let ff2mpv_message = serde_json::from_str(&message)?;
@ -32,13 +28,3 @@ fn read_message() -> Result<String, io::Error> {
reader.read_to_string(&mut string)?; reader.read_to_string(&mut string)?;
Ok(string) Ok(string)
} }
fn send_message(message: &str) -> Result<(), io::Error> {
let length = (message.len() as u32).to_ne_bytes();
let message = message.as_bytes();
let mut stdout = io::stdout();
stdout.write_all(&length)?;
stdout.write_all(message)?;
Ok(())
}