@@ -74,20 +74,17 @@ where
7474 ) ;
7575 } ;
7676 response_wrapper. log ( ) ;
77- if response_wrapper. message . is_some ( ) && response_wrapper. nonce . is_some ( ) {
78- let ( message, nonce) = (
79- response_wrapper. message . unwrap ( ) ,
80- response_wrapper. nonce . unwrap ( ) ,
81- ) ;
82- let decrypted_response_json = to_decrypted_json ( message, nonce) ?;
83- let response: R = serde_json:: from_str ( & decrypted_response_json) ?;
84- Ok ( ( response, decrypted_response_json) )
85- } else {
86- Err ( KeePassError {
77+ match ( & response_wrapper. message , & response_wrapper. nonce ) {
78+ ( Some ( message) , Some ( nonce) ) => {
79+ let decrypted_response_json = to_decrypted_json ( message, nonce) ?;
80+ let response: R = serde_json:: from_str ( & decrypted_response_json) ?;
81+ Ok ( ( response, decrypted_response_json) )
82+ }
83+ _ => Err ( KeePassError {
8784 message : response_wrapper. error_message ( ) ,
8885 response : response_wrapper,
8986 }
90- . into ( ) )
87+ . into ( ) ) ,
9188 }
9289 }
9390
@@ -608,7 +605,7 @@ impl GetDatabaseGroupsResponse {
608605 & self . groups . groups
609606 }
610607
611- pub fn get_flat_groups ( & self ) -> Vec < FlatGroup > {
608+ pub fn get_flat_groups ( & self ) -> Vec < FlatGroup < ' _ > > {
612609 self . get_groups ( )
613610 . iter ( )
614611 . map ( |g| g. get_flat_groups ( vec ! [ ] ) )
0 commit comments