Skip to content

Commit

Permalink
[ISSUE #1851]Adding #[inline] for QueryResult methods (#2269)
Browse files Browse the repository at this point in the history
  • Loading branch information
nakul-py authored Jan 15, 2025
1 parent c8d1c1b commit 185f91c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rocketmq-client/src/base/query_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub struct QueryResult {

impl QueryResult {
// Constructor equivalent
#[inline]
pub fn new(index_last_update_timestamp: u64, message_list: Vec<MessageExt>) -> Self {
QueryResult {
index_last_update_timestamp,
Expand All @@ -34,17 +35,20 @@ impl QueryResult {
}

// Getter methods equivalent
#[inline]
pub fn index_last_update_timestamp(&self) -> u64 {
self.index_last_update_timestamp
}

#[inline]
pub fn message_list(&self) -> &Vec<MessageExt> {
&self.message_list
}
}

// Implementing the Display trait for pretty printing, similar to Java's toString method
impl fmt::Display for QueryResult {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
Expand Down

0 comments on commit 185f91c

Please sign in to comment.