From a43401b6c4a5b2d06bab2b1c073168d6fa4b149d Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 18 Jun 2019 17:32:42 +0200 Subject: [PATCH] Replaced trim_right() with trim_end(), as the former is deprecated --- src/ipc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipc.rs b/src/ipc.rs index f9c8a00..5414d2b 100644 --- a/src/ipc.rs +++ b/src/ipc.rs @@ -281,7 +281,7 @@ pub fn observe_mpv_property(instance: &Mpv, id: &usize, property: &str) -> Resul pub fn listen(instance: &mut Mpv) -> Result { let mut response = String::new(); instance.reader.read_line(&mut response).unwrap(); - response = response.trim_right().to_string(); + response = response.trim_end().to_string(); match serde_json::from_str::(&response) { Ok(e) => { if let Value::String(ref name) = e["event"] { @@ -406,7 +406,7 @@ pub fn listen(instance: &mut Mpv) -> Result { pub fn listen_raw(instance: &mut Mpv) -> String { let mut response = String::new(); instance.reader.read_line(&mut response).unwrap(); - response.trim_right().to_string() + response.trim_end().to_string() // let mut stream = &instance.0; // let mut buffer = [0; 32]; // stream.read(&mut buffer[..]).unwrap();