1
1
use actix_web:: { http:: StatusCode , ResponseError } ;
2
- use derive_more:: Display ;
2
+ use derive_more:: derive :: Display ;
3
3
4
4
/// Errors which can occur when serving static files.
5
5
#[ derive( Debug , PartialEq , Eq , Display ) ]
6
6
pub enum FilesError {
7
7
/// Path is not a directory.
8
8
#[ allow( dead_code) ]
9
- #[ display( fmt = "path is not a directory. Unable to serve static files" ) ]
9
+ #[ display( "path is not a directory. Unable to serve static files" ) ]
10
10
IsNotDirectory ,
11
11
12
12
/// Cannot render directory.
13
- #[ display( fmt = "unable to render directory without index file" ) ]
13
+ #[ display( "unable to render directory without index file" ) ]
14
14
IsDirectory ,
15
15
}
16
16
@@ -25,19 +25,19 @@ impl ResponseError for FilesError {
25
25
#[ non_exhaustive]
26
26
pub enum UriSegmentError {
27
27
/// Segment started with the wrapped invalid character.
28
- #[ display( fmt = "segment started with invalid character: ('{_0}')" ) ]
28
+ #[ display( "segment started with invalid character: ('{_0}')" ) ]
29
29
BadStart ( char ) ,
30
30
31
31
/// Segment contained the wrapped invalid character.
32
- #[ display( fmt = "segment contained invalid character ('{_0}')" ) ]
32
+ #[ display( "segment contained invalid character ('{_0}')" ) ]
33
33
BadChar ( char ) ,
34
34
35
35
/// Segment ended with the wrapped invalid character.
36
- #[ display( fmt = "segment ended with invalid character: ('{_0}')" ) ]
36
+ #[ display( "segment ended with invalid character: ('{_0}')" ) ]
37
37
BadEnd ( char ) ,
38
38
39
39
/// Path is not a valid UTF-8 string after percent-decoding.
40
- #[ display( fmt = "path is not a valid UTF-8 string after percent-decoding" ) ]
40
+ #[ display( "path is not a valid UTF-8 string after percent-decoding" ) ]
41
41
NotValidUtf8 ,
42
42
}
43
43
0 commit comments