Make clippy happy

This commit is contained in:
Ryze 2023-03-14 14:25:43 +03:00
parent ab554ead23
commit 7de78329fb
Signed by: ryze
GPG key ID: 9B296C5CEAEAAAC1
2 changed files with 7 additions and 7 deletions

View file

@ -9,12 +9,12 @@ pub struct MpvMessage {
pub fn get_mpv_message() -> Result<MpvMessage, String> { pub fn get_mpv_message() -> Result<MpvMessage, String> {
let message = match get_browser_message() { let message = match get_browser_message() {
Ok(msg) => msg, Ok(msg) => msg,
Err(e) => return Err(format!("IO Error: {}", e)) Err(e) => return Err(format!("IO Error: {e}"))
}; };
match serde_json::from_str(&message) { match serde_json::from_str(&message) {
Ok(msg) => Ok(msg), Ok(msg) => Ok(msg),
Err(e) => Err(format!("JSON Error: {}", e)) Err(e) => Err(format!("JSON Error: {e}"))
} }
} }
@ -36,7 +36,7 @@ pub fn send_browser_message(message: &str) -> io::Result<()> {
let message = message.as_bytes(); let message = message.as_bytes();
let mut stdout = io::stdout(); let mut stdout = io::stdout();
stdout.write(&length)?; stdout.write_all(&length)?;
stdout.write(&message)?; stdout.write_all(message)?;
Ok(()) Ok(())
} }

View file

@ -5,7 +5,7 @@ fn main() {
let message = match get_mpv_message() { let message = match get_mpv_message() {
Ok(msg) => msg, Ok(msg) => msg,
Err(e) => { Err(e) => {
eprintln!("{}", e); eprintln!("{e}");
process::exit(-1) process::exit(-1)
} }
}; };
@ -15,12 +15,12 @@ fn main() {
.spawn(); .spawn();
if let Err(e) = mpv { if let Err(e) = mpv {
eprintln!("{}", e); eprintln!("{e}");
process::exit(-1); process::exit(-1);
} }
if let Err(e) = send_browser_message("ok") { if let Err(e) = send_browser_message("ok") {
eprintln!("{}", e); eprintln!("{e}");
process::exit(-1); process::exit(-1);
} }
} }