File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,9 @@ pub enum Error {
31
31
Win32Error ( #[ from] windows:: core:: Error ) ,
32
32
#[ error( "Path doesn't have a parent: {0}" ) ]
33
33
NoParent ( PathBuf ) ,
34
- #[ error( "Path is invalid: {0}" ) ]
35
- InvalidPath ( PathBuf ) ,
34
+ #[ cfg( windows) ]
35
+ #[ error( "Failed to convert path '{0}' to ITEMIDLIST" ) ]
36
+ FailedToConvertPathToItemIdList ( PathBuf ) ,
36
37
#[ error( "Failed to convert path to file:// url" ) ]
37
38
FailedToConvertPathToFileUrl ,
38
39
#[ error( transparent) ]
Original file line number Diff line number Diff line change @@ -169,7 +169,9 @@ mod imp {
169
169
let path_hstring = HSTRING :: from ( path) ;
170
170
let item_id_list = unsafe { ILCreateFromPathW ( & path_hstring) } ;
171
171
if item_id_list. is_null ( ) {
172
- Err ( crate :: Error :: InvalidPath ( path. to_owned ( ) ) )
172
+ Err ( crate :: Error :: FailedToConvertPathToItemIdList (
173
+ path. to_owned ( ) ,
174
+ ) )
173
175
} else {
174
176
Ok ( Self {
175
177
hstring : path_hstring,
You can’t perform that action at this time.
0 commit comments