@@ -51,50 +51,50 @@ fn strip_verbatim_from_prefix(prefix: &PrefixComponent<'_>) -> Option<PathBuf> {
5151}
5252
5353#[ derive( Debug ) ]
54- struct DirRemoveError {
54+ struct RemoveError {
5555 kind : std:: io:: ErrorKind ,
5656 path : String ,
5757}
5858
59- impl std:: error:: Error for DirRemoveError { }
59+ impl std:: error:: Error for RemoveError { }
6060
61- impl std:: fmt:: Display for DirRemoveError {
61+ impl std:: fmt:: Display for RemoveError {
6262 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
6363 f. write_fmt ( format_args ! (
64- "failed to remove directory '{}' : {:?}" ,
64+ "failed to remove '{}' : {:?}" ,
6565 self . path, self . kind
6666 ) )
6767 }
6868}
6969
70- pub ( crate ) fn improve_remove_dir_error ( error : std:: io:: Error , path : & Path ) -> std:: io:: Error {
70+ pub ( crate ) fn improve_remove_error ( error : std:: io:: Error , path : & Path ) -> std:: io:: Error {
7171 std:: io:: Error :: new (
7272 error. kind ( ) ,
73- DirRemoveError {
73+ RemoveError {
7474 kind : error. kind ( ) ,
7575 path : path. display ( ) . to_string ( ) ,
7676 } ,
7777 )
7878}
7979
8080#[ test]
81- fn custom_remove_dir_error ( ) {
81+ fn custom_remove_error ( ) {
8282 let path = "test/path" . as_ref ( ) ;
8383
84- let expected = "failed to remove directory 'test/path' : PermissionDenied" ;
84+ let expected = "failed to remove 'test/path' : PermissionDenied" ;
8585 let tested = format ! (
8686 "{}" ,
87- improve_remove_dir_error (
87+ improve_remove_error (
8888 std:: io:: Error :: from( std:: io:: ErrorKind :: PermissionDenied ) ,
8989 path
9090 )
9191 ) ;
9292 assert_eq ! ( expected, tested) ;
9393
94- let expected = "Custom { kind: PermissionDenied, error: DirRemoveError { kind: PermissionDenied, path: \" test/path\" } }" ;
94+ let expected = "Custom { kind: PermissionDenied, error: RemoveError { kind: PermissionDenied, path: \" test/path\" } }" ;
9595 let tested = format ! (
9696 "{:?}" ,
97- improve_remove_dir_error (
97+ improve_remove_error (
9898 std:: io:: Error :: from( std:: io:: ErrorKind :: PermissionDenied ) ,
9999 path
100100 )
0 commit comments