This repository was archived by the owner on Dec 29, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-21
lines changed Expand file tree Collapse file tree 3 files changed +15
-21
lines changed Original file line number Diff line number Diff line change @@ -550,18 +550,15 @@ impl ::std::fmt::Display for Id {
550550 }
551551}
552552
553- impl :: std:: error:: Error for AError {
554- fn description ( & self ) -> & str {
555- match * self {
556- AError :: MutexPoison => "poison error in a mutex (usually a secondary error)" ,
557- AError :: Unclassified => "unknown error" ,
558- }
559- }
560- }
553+ impl :: std:: error:: Error for AError { }
561554
562555impl :: std:: fmt:: Display for AError {
563556 fn fmt ( & self , f : & mut :: std:: fmt:: Formatter < ' _ > ) -> :: std:: fmt:: Result {
564- write ! ( f, "{}" , :: std:: error:: Error :: description( self ) )
557+ let description = match self {
558+ AError :: MutexPoison => "poison error in a mutex (usually a secondary error)" ,
559+ AError :: Unclassified => "unknown error" ,
560+ } ;
561+ write ! ( f, "{}" , description)
565562 }
566563}
567564
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ pub enum Error {
127127 InternalError ( & ' static str ) ,
128128}
129129
130- impl :: std :: error :: Error for Error {
130+ impl Error {
131131 fn description ( & self ) -> & str {
132132 match * self {
133133 Error :: OutOfSync ( ref _path_buf) => "file out of sync with filesystem" ,
@@ -148,7 +148,7 @@ impl ::std::error::Error for Error {
148148
149149impl Into < String > for Error {
150150 fn into ( self ) -> String {
151- :: std :: error :: Error :: description ( & self ) . to_owned ( )
151+ self . description ( ) . to_owned ( )
152152 }
153153}
154154
@@ -166,7 +166,7 @@ impl fmt::Display for Error {
166166 | Error :: FileNotCached
167167 | Error :: NoUserDataForFile
168168 | Error :: Io ( ..)
169- | Error :: BadFileKind => f. write_str ( :: std :: error :: Error :: description ( self ) ) ,
169+ | Error :: BadFileKind => f. write_str ( self . description ( ) ) ,
170170 }
171171 }
172172}
Original file line number Diff line number Diff line change @@ -25,21 +25,18 @@ pub enum UrlFileParseError {
2525 InvalidFilePath ,
2626}
2727
28- impl Error for UrlFileParseError {
29- fn description ( & self ) -> & str {
30- match * self {
31- UrlFileParseError :: InvalidScheme => "URI scheme is not `file`" ,
32- UrlFileParseError :: InvalidFilePath => "Invalid file path in URI" ,
33- }
34- }
35- }
28+ impl Error for UrlFileParseError { }
3629
3730impl fmt:: Display for UrlFileParseError
3831where
3932 UrlFileParseError : Error ,
4033{
4134 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
42- write ! ( f, "{}" , self . description( ) )
35+ let description = match self {
36+ UrlFileParseError :: InvalidScheme => "URI scheme is not `file`" ,
37+ UrlFileParseError :: InvalidFilePath => "Invalid file path in URI" ,
38+ } ;
39+ write ! ( f, "{}" , description)
4340 }
4441}
4542
You can’t perform that action at this time.
0 commit comments