Skip to content

Commit

Permalink
[ISSUE #1002]🐛Fix clippy check error on ConfigManager (#1003)
Browse files Browse the repository at this point in the history
* [ISSUE #1002]🐛Fix clippy check error on ConfigManager #1002

* fix code style
  • Loading branch information
mxsm authored Sep 26, 2024
1 parent 306fafe commit 75eef82
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions rocketmq-client/src/implementation/mq_client_api_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ impl MQClientAPIImpl {
))
}
}
return Err(MQClientError::MQClientErr(
Err(MQClientError::MQClientErr(
code,
result.remark().cloned().unwrap_or_default(),
));
))
}
Err(err) => Err(MQClientError::RemotingError(err)),
}
Expand Down
4 changes: 2 additions & 2 deletions rocketmq-common/src/common/config_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub trait ConfigManager {
/// * `false` if the configuration loading fails.
fn load_bak(&self) -> bool {
let file_name = self.config_file_path();
return if let Ok(ref content) =
if let Ok(ref content) =
FileUtils::file_to_string(format!("{}{}", file_name, ".bak").as_str())
{
if !content.is_empty() {
Expand All @@ -75,7 +75,7 @@ pub trait ConfigManager {
} else {
error!("load Config file: {}.bak -----Failed", file_name);
false
};
}
}

/// Persists the configuration with a topic.
Expand Down
1 change: 0 additions & 1 deletion rocketmq-store/src/queue/batch_consume_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const INVALID_POS: i32 = -1;
/// BatchConsumeQueue's store unit. Size:
/// CommitLog Physical Offset(8) + Body Size(4) + Tag HashCode(8) + Store time(8) +
/// msgBaseOffset(8) + batchSize(2) + compactedOffset(4) + reserved(4)= 46 Bytes

pub struct BatchConsumeQueue {
message_store_config: Arc<MessageStoreConfig>,
mapped_file_queue: MappedFileQueue,
Expand Down
7 changes: 3 additions & 4 deletions rocketmq-store/src/queue/single_consume_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ use crate::queue::FileQueueLifeCycle;
use crate::store::running_flags::RunningFlags;
use crate::store_path_config_helper::get_store_path_consume_queue_ext;

pub const CQ_STORE_UNIT_SIZE: i32 = 20;
pub const MSG_TAG_OFFSET_INDEX: i32 = 12;

///
/// ConsumeQueue's store unit. Format:
///
Expand All @@ -62,10 +65,6 @@ use crate::store_path_config_helper::get_store_path_consume_queue_ext;
/// </pre>
/// ConsumeQueue's store unit. Size: CommitLog Physical Offset(8) + Body Size(4) + Tag HashCode(8) =
/// 20 Bytes

pub const CQ_STORE_UNIT_SIZE: i32 = 20;
pub const MSG_TAG_OFFSET_INDEX: i32 = 12;

#[derive(Clone)]
pub struct ConsumeQueue {
message_store_config: Arc<MessageStoreConfig>,
Expand Down

0 comments on commit 75eef82

Please sign in to comment.