From 4a21b5cbeb4ab5749bc8a3e4c8747f4eb1397596 Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Fri, 24 Jul 2020 03:32:36 +0100 Subject: [PATCH] Fix depreciation warnings Fixes error description depreciation warnings and removes unnecessary parentheses --- audio/src/lewton_decoder.rs | 4 ---- connect/src/spirc.rs | 4 ++-- core/src/proxytunnel.rs | 3 +-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/audio/src/lewton_decoder.rs b/audio/src/lewton_decoder.rs index 912d1c27..b9f05d4c 100644 --- a/audio/src/lewton_decoder.rs +++ b/audio/src/lewton_decoder.rs @@ -71,10 +71,6 @@ impl fmt::Display for VorbisError { } impl error::Error for VorbisError { - fn description(&self) -> &str { - error::Error::description(&self.0) - } - fn source(&self) -> Option<&(dyn error::Error + 'static)> { error::Error::source(&self.0) } diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 0dd67093..dd16246b 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -454,8 +454,8 @@ impl SpircTask { Ok(dur) => dur, Err(err) => err.duration(), }; - ((dur.as_secs() as i64 + self.session.time_delta()) * 1000 - + (dur.subsec_nanos() / 1000_000) as i64) + (dur.as_secs() as i64 + self.session.time_delta()) * 1000 + + (dur.subsec_nanos() / 1000_000) as i64 } fn ensure_mixer_started(&mut self) { diff --git a/core/src/proxytunnel.rs b/core/src/proxytunnel.rs index ea84bc88..b1363846 100644 --- a/core/src/proxytunnel.rs +++ b/core/src/proxytunnel.rs @@ -1,4 +1,3 @@ -use std::error::Error; use std::io; use std::str::FromStr; @@ -58,7 +57,7 @@ impl Future for ProxyTunnel { let status = match response.parse(&buf) { Ok(status) => status, Err(err) => { - return Err(io::Error::new(io::ErrorKind::Other, err.description())); + return Err(io::Error::new(io::ErrorKind::Other, err.to_string())); } };