@@ -18,6 +18,7 @@ use databend_common_meta_api::kv_pb_api::KVPbApi;
1818use databend_common_meta_api:: kv_pb_api:: UpsertPB ;
1919use databend_common_meta_api:: meta_txn_error:: MetaTxnError ;
2020use databend_common_meta_api:: reply:: unpack_txn_reply;
21+ use databend_common_meta_api:: serialize_struct;
2122use databend_common_meta_api:: txn_backoff:: txn_backoff;
2223use databend_common_meta_api:: txn_cond_seq;
2324use databend_common_meta_api:: txn_op_del;
@@ -447,7 +448,7 @@ impl RoleApi for RoleMgr {
447448 need_transfer = true ;
448449 let object = own. data . object ;
449450 let owner_key = self . ownership_object_ident ( & object) ;
450- let owner_value = databend_common_meta_api :: serialize_struct ( & OwnershipInfo {
451+ let owner_value = serialize_struct ( & OwnershipInfo {
451452 object,
452453 role : BUILTIN_ROLE_ACCOUNT_ADMIN . to_string ( ) ,
453454 } ) ?;
@@ -490,7 +491,7 @@ impl RoleApi for RoleMgr {
490491 let grant_object = convert_to_grant_obj ( object) ;
491492
492493 let owner_key = self . ownership_object_ident ( object) ;
493- let owner_value = databend_common_meta_api :: serialize_struct ( & OwnershipInfo {
494+ let owner_value = serialize_struct ( & OwnershipInfo {
494495 object : object. clone ( ) ,
495496 role : new_role. to_string ( ) ,
496497 } ) ?;
@@ -510,10 +511,7 @@ impl RoleApi for RoleMgr {
510511 ) ;
511512 old_role_info. update_role_time ( ) ;
512513 condition. push ( txn_cond_seq ( & old_key, Eq , old_seq) ) ;
513- if_then. push ( txn_op_put (
514- & old_key,
515- databend_common_meta_api:: serialize_struct ( & old_role_info) ?,
516- ) ) ;
514+ if_then. push ( txn_op_put ( & old_key, serialize_struct ( & old_role_info) ?) ) ;
517515 }
518516 }
519517
@@ -624,10 +622,7 @@ impl RoleApi for RoleMgr {
624622 ) ;
625623 old_role_info. update_role_time ( ) ;
626624 condition. push ( txn_cond_seq ( & old_key, Eq , old_seq) ) ;
627- if_then. push ( txn_op_put (
628- & old_key,
629- databend_common_meta_api:: serialize_struct ( & old_role_info) ?,
630- ) ) ;
625+ if_then. push ( txn_op_put ( & old_key, serialize_struct ( & old_role_info) ?) ) ;
631626 }
632627 }
633628 }
0 commit comments