File tree 1 file changed +7
-13
lines changed
crates/forge_permission_resolver/src
1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -26,20 +26,14 @@ impl From<SerializablePermissionHashMap> for PermissionHashMap {
26
26
let deserialized_map: PermissionHashMap = serialized
27
27
. map
28
28
. into_iter ( )
29
- . filter_map ( |( key, v) | {
29
+ . map ( |( key, v) | {
30
30
let mut parts = key. split ( "::" ) ;
31
- let url = parts. next ( ) ;
32
- let req = parts. next ( ) ;
33
- if let ( Some ( url) , Some ( req) ) = ( url, req) {
34
- match req. parse :: < RequestType > ( ) {
35
- Ok ( req_type) => Some ( ( ( url. to_string ( ) , req_type) , v) ) ,
36
- Err ( _) => {
37
- panic ! ( "Failed to parse RequestType from: {}" , req) ;
38
- }
39
- }
40
- } else {
41
- panic ! ( "Failed to split key: {}" , key) ;
42
- }
31
+ let url = parts. next ( ) . expect ( "Failed to split key" ) ;
32
+ let req = parts. next ( ) . expect ( "Failed to split key" ) ;
33
+ let req_type = req
34
+ . parse :: < RequestType > ( )
35
+ . expect ( "Failed to parse RequestType" ) ;
36
+ ( ( url. to_string ( ) , req_type) , v)
43
37
} )
44
38
. collect ( ) ;
45
39
deserialized_map
You can’t perform that action at this time.
0 commit comments