Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #1002]🐛Fix clippy check error on ConfigManager #1003

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading