Skip to content

Commit 7b6df5d

Browse files
authored
Adding #[inline] for PopRequest method (#1789)
1 parent 85ea6d2 commit 7b6df5d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

rocketmq-client/src/consumer/consumer_impl/pop_request.rs

+17
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pub struct PopRequest {
3535
}
3636

3737
impl PopRequest {
38+
#[inline]
3839
pub fn new(
3940
topic: CheetahString,
4041
consumer_group: CheetahString,
@@ -52,62 +53,76 @@ impl PopRequest {
5253
}
5354
}
5455

56+
#[inline]
5557
pub fn is_locked_first(&self) -> bool {
5658
self.locked_first
5759
}
5860

61+
#[inline]
5962
pub fn set_locked_first(&mut self, locked_first: bool) {
6063
self.locked_first = locked_first;
6164
}
6265

66+
#[inline]
6367
pub fn get_consumer_group(&self) -> &str {
6468
&self.consumer_group
6569
}
6670

71+
#[inline]
6772
pub fn set_consumer_group(&mut self, consumer_group: CheetahString) {
6873
self.consumer_group = consumer_group;
6974
}
7075

76+
#[inline]
7177
pub fn get_message_queue(&self) -> &MessageQueue {
7278
&self.message_queue
7379
}
7480

81+
#[inline]
7582
pub fn set_message_queue(&mut self, message_queue: MessageQueue) {
7683
self.message_queue = message_queue;
7784
}
7885

86+
#[inline]
7987
pub fn get_topic(&self) -> &str {
8088
&self.topic
8189
}
8290

91+
#[inline]
8392
pub fn set_topic(&mut self, topic: CheetahString) {
8493
self.topic = topic;
8594
}
8695

96+
#[inline]
8797
pub fn get_pop_process_queue(&self) -> &PopProcessQueue {
8898
&self.pop_process_queue
8999
}
90100

101+
#[inline]
91102
pub fn set_pop_process_queue(&mut self, pop_process_queue: PopProcessQueue) {
92103
self.pop_process_queue = pop_process_queue;
93104
}
94105

106+
#[inline]
95107
pub fn get_init_mode(&self) -> i32 {
96108
self.init_mode
97109
}
98110

111+
#[inline]
99112
pub fn set_init_mode(&mut self, init_mode: i32) {
100113
self.init_mode = init_mode;
101114
}
102115
}
103116

104117
impl MessageRequest for PopRequest {
118+
#[inline]
105119
fn get_message_request_mode(&self) -> MessageRequestMode {
106120
MessageRequestMode::Pop
107121
}
108122
}
109123

110124
impl Hash for PopRequest {
125+
#[inline]
111126
fn hash<H: Hasher>(&self, state: &mut H) {
112127
self.topic.hash(state);
113128
self.consumer_group.hash(state);
@@ -116,6 +131,7 @@ impl Hash for PopRequest {
116131
}
117132

118133
impl PartialEq for PopRequest {
134+
#[inline]
119135
fn eq(&self, other: &Self) -> bool {
120136
self.topic == other.topic
121137
&& self.consumer_group == other.consumer_group
@@ -126,6 +142,7 @@ impl PartialEq for PopRequest {
126142
impl Eq for PopRequest {}
127143

128144
impl std::fmt::Display for PopRequest {
145+
#[inline]
129146
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
130147
write!(
131148
f,

0 commit comments

Comments
 (0)