Skip to content

Commit e0e203c

Browse files
committed
use ?? replace double unwrap
1 parent 869a6eb commit e0e203c

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

src/meta/api/src/schema_api_test_suite.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3195,7 +3195,7 @@ impl SchemaApiTestSuite {
31953195
update_on: None,
31963196
},
31973197
};
3198-
mt.create_data_mask(req).await.unwrap().unwrap();
3198+
mt.create_data_mask(req).await??;
31993199

32003200
let mask1_name_ident = DataMaskNameIdent::new(tenant.clone(), mask_name_1.to_string());
32013201
mask1_id = get_kv_u64_data(mt, &mask1_name_ident).await?;
@@ -3212,7 +3212,7 @@ impl SchemaApiTestSuite {
32123212
update_on: None,
32133213
},
32143214
};
3215-
mt.create_data_mask(req).await.unwrap().unwrap();
3215+
mt.create_data_mask(req).await??;
32163216

32173217
let mask2_name_ident = DataMaskNameIdent::new(tenant.clone(), mask_name_2.to_string());
32183218
mask2_id = get_kv_u64_data(mt, &mask2_name_ident).await?;
@@ -3473,7 +3473,7 @@ impl SchemaApiTestSuite {
34733473
update_on: None,
34743474
},
34753475
};
3476-
mt.create_data_mask(req).await.unwrap().unwrap();
3476+
mt.create_data_mask(req).await??;
34773477
let old_id: u64 = get_kv_u64_data(mt, &name).await?;
34783478

34793479
let id_key = DataMaskIdIdent::new(&tenant, old_id);
@@ -3493,7 +3493,7 @@ impl SchemaApiTestSuite {
34933493
update_on: None,
34943494
},
34953495
};
3496-
mt.create_data_mask(req).await.unwrap().unwrap();
3496+
mt.create_data_mask(req).await??;
34973497

34983498
// assert old id key has been deleted
34993499
let meta: Result<DatamaskMeta, KVAppError> = get_kv_data(mt, &id_key).await;
@@ -3559,7 +3559,7 @@ impl SchemaApiTestSuite {
35593559
update_on: None,
35603560
},
35613561
};
3562-
mt.create_row_access_policy(req).await.unwrap().unwrap();
3562+
mt.create_row_access_policy(req).await??;
35633563

35643564
let name = RowAccessPolicyNameIdent::new(tenant.clone(), policy1.to_string());
35653565
let res = mt.get_row_access_policy(&name).await.unwrap().unwrap();
@@ -3576,7 +3576,7 @@ impl SchemaApiTestSuite {
35763576
update_on: None,
35773577
},
35783578
};
3579-
mt.create_row_access_policy(req).await.unwrap().unwrap();
3579+
mt.create_row_access_policy(req).await??;
35803580

35813581
let table_id_1;
35823582
info!("--- apply mask1 policy to table 1 and check");
@@ -3898,9 +3898,7 @@ impl SchemaApiTestSuite {
38983898
update_on: None,
38993899
},
39003900
})
3901-
.await
3902-
.unwrap()
3903-
.unwrap();
3901+
.await??;
39043902
let mask_cleanup_id = get_kv_u64_data(mt, &mask_cleanup_ident).await?;
39053903

39063904
let set_req = SetTableColumnMaskPolicyReq {
@@ -3963,9 +3961,7 @@ impl SchemaApiTestSuite {
39633961
update_on: None,
39643962
},
39653963
})
3966-
.await
3967-
.unwrap()
3968-
.unwrap();
3964+
.await??;
39693965
let mask_guard_id = get_kv_u64_data(mt, &mask_guard_ident).await?;
39703966

39713967
table_info = util.get_table().await?;
@@ -4057,8 +4053,7 @@ impl SchemaApiTestSuite {
40574053
update_on: None,
40584054
},
40594055
})
4060-
.await?
4061-
.unwrap();
4056+
.await??;
40624057
let cleanup_policy_id = {
40634058
let res = mt
40644059
.get_row_access_policy(&policy_cleanup_ident)
@@ -4132,8 +4127,7 @@ impl SchemaApiTestSuite {
41324127
update_on: None,
41334128
},
41344129
})
4135-
.await?
4136-
.unwrap();
4130+
.await??;
41374131
let guard_policy_id = {
41384132
let res = mt
41394133
.get_row_access_policy(&policy_guard_ident)

0 commit comments

Comments
 (0)