From bc71907a50fb92d280f3a6a6701091a1e246eb86 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 4 Oct 2019 12:17:05 +0100 Subject: [PATCH] Tag trait objects with the 'dyn' keyword The dyn keyword is now mandatory for trait objects (RFC 2113) and rustc emits a warning where it is missing. --- src/convert.rs | 2 +- src/error.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/convert.rs b/src/convert.rs index 883ce784..ce03b0d3 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -301,7 +301,7 @@ impl<'a, T: ToSongPath> ToSongPath for &'a T { } } -impl ToSongPath for AsRef { +impl ToSongPath for dyn AsRef { fn to_path(&self) -> &str { self.as_ref() } diff --git a/src/error.rs b/src/error.rs index 4420cc63..65361982 100644 --- a/src/error.rs +++ b/src/error.rs @@ -182,7 +182,7 @@ pub enum Error { pub type Result = result::Result; impl StdError for Error { - fn cause(&self) -> Option<&StdError> { + fn cause(&self) -> Option<&dyn StdError> { match *self { Error::Io(ref err) => Some(err), Error::Parse(ref err) => Some(err),