@@ -20,7 +20,7 @@ pub(crate) enum ErrorKind {
2020}
2121
2222impl ErrorKind {
23- fn as_str ( & self ) -> & str {
23+ fn as_str ( self ) -> & ' static str {
2424 match self {
2525 ErrorKind :: CommunicationError => "couldn't establish communications with the pair" ,
2626 ErrorKind :: SessionDeclined => "pair declined the session" ,
@@ -51,14 +51,14 @@ impl Display for Error {
5151impl Fail for Error { }
5252
5353impl From < ErrorKind > for Error {
54- fn from ( kind : ErrorKind ) -> Error {
55- Error :: from ( Context :: new ( kind) )
54+ fn from ( kind : ErrorKind ) -> Self {
55+ Self :: from ( Context :: new ( kind) )
5656 }
5757}
5858
5959impl From < Context < ErrorKind > > for Error {
60- fn from ( inner : Context < ErrorKind > ) -> Error {
61- Error { inner : inner }
60+ fn from ( inner : Context < ErrorKind > ) -> Self {
61+ Self { inner }
6262 }
6363}
6464
@@ -68,8 +68,8 @@ impl From<Context<ErrorKind>> for Error {
6868/// converted to an Unauthorized error.
6969///
7070impl From < Error > for SudoPluginError {
71- fn from ( error : Error ) -> SudoPluginError {
72- SudoPluginError :: with_chain (
71+ fn from ( error : Error ) -> Self {
72+ Self :: with_chain (
7373 error. compat ( ) ,
7474 SudoPluginErrorKind :: Unauthorized
7575 )
@@ -81,7 +81,7 @@ impl From<Error> for SudoPluginError {
8181/// implicitly wrapped in a new `Error`.
8282///
8383impl From < ErrorKind > for SudoPluginError {
84- fn from ( kind : ErrorKind ) -> SudoPluginError {
85- SudoPluginError :: from ( Error :: from ( kind) )
84+ fn from ( kind : ErrorKind ) -> Self {
85+ Self :: from ( Error :: from ( kind) )
8686 }
8787}
0 commit comments