From 235451b9e5037f94df5c6e3c9d13c9cfe960322b Mon Sep 17 00:00:00 2001 From: IHEII Date: Sun, 28 Apr 2024 11:13:46 +0800 Subject: [PATCH] [Chore] rename func (#94) --- src/rpc/protocol/lsop.rs | 11 +++++------ src/rpc/protocol/payloads.rs | 2 +- src/rpc/protocol/query_and_mutate.rs | 9 ++++----- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/rpc/protocol/lsop.rs b/src/rpc/protocol/lsop.rs index 8ab983d..5da5bac 100644 --- a/src/rpc/protocol/lsop.rs +++ b/src/rpc/protocol/lsop.rs @@ -92,7 +92,7 @@ impl ObTableSingleOpFlag { pub fn new() -> Self { let mut flag = ObTableSingleOpFlag { flags: 0 }; - flag.set_flag_is_check_not_exist(false); + flag.set_flag_check_not_exist(false); flag } @@ -104,8 +104,8 @@ impl ObTableSingleOpFlag { self.flags = flags; } - pub fn set_flag_is_check_not_exist(&mut self, is_check_not_exist: bool) { - if is_check_not_exist { + pub fn set_flag_check_not_exist(&mut self, check_not_exist: bool) { + if check_not_exist { self.flags |= Self::FLAG_IS_CHECK_NOT_EXISTS; } else { self.flags &= !Self::FLAG_IS_CHECK_NOT_EXISTS; @@ -710,9 +710,8 @@ impl ObTableSingleOp { self.query = Some(query) } - pub fn set_is_check_not_exists(&mut self, is_check_not_exists: bool) { - self.op_flag - .set_flag_is_check_not_exist(is_check_not_exists) + pub fn set_check_not_exists(&mut self, check_not_exists: bool) { + self.op_flag.set_flag_check_not_exist(check_not_exists) } pub fn is_check_not_exist(&self) -> bool { diff --git a/src/rpc/protocol/payloads.rs b/src/rpc/protocol/payloads.rs index f78c135..8003b1e 100644 --- a/src/rpc/protocol/payloads.rs +++ b/src/rpc/protocol/payloads.rs @@ -1030,7 +1030,7 @@ impl ObTableBatchOperation { // generate single op let mut single_op = ObTableSingleOp::new(ObTableOperationType::CheckAndInsertUp); - single_op.set_is_check_not_exists(!option.check_exists); + single_op.set_check_not_exists(!option.check_exists); single_op.set_query(query); single_op.add_entity(entity); diff --git a/src/rpc/protocol/query_and_mutate.rs b/src/rpc/protocol/query_and_mutate.rs index 1faf40c..28a95b1 100644 --- a/src/rpc/protocol/query_and_mutate.rs +++ b/src/rpc/protocol/query_and_mutate.rs @@ -50,8 +50,8 @@ impl ObTableQueryAndMutateFlag { } } - pub fn set_is_check_not_exists(&mut self, is_check_not_exists: bool) { - if is_check_not_exists { + pub fn set_check_not_exists(&mut self, check_not_exists: bool) { + if check_not_exists { self.flags |= Self::FLAG_IS_CHECK_NOT_EXISTS; } else { self.flags &= !Self::FLAG_IS_CHECK_NOT_EXISTS; @@ -130,9 +130,8 @@ impl ObTableQueryAndMutate { self.option_flag.is_check_and_execute() } - pub fn set_is_check_not_exists(&mut self, is_check_not_exists: bool) { - self.option_flag - .set_is_check_not_exists(is_check_not_exists) + pub fn set_check_not_exists(&mut self, check_not_exists: bool) { + self.option_flag.set_check_not_exists(check_not_exists) } pub fn is_check_not_exists(&self) -> bool {