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

fix: fix clippy #553

Merged
merged 6 commits into from
Oct 20, 2024
Merged

fix: fix clippy #553

merged 6 commits into from
Oct 20, 2024

Conversation

datbeohbbh
Copy link
Contributor

comment fix-ci

Signed-off-by: Dat Tien Nguyen <phongtomfapp@gmail.com>
Signed-off-by: Dat Tien Nguyen <phongtomfapp@gmail.com>
@datbeohbbh
Copy link
Contributor Author

datbeohbbh commented Oct 14, 2024

clippy emits a false-positive error on mutating codes in datadriven.

it's known issue: rust-lang/rust-clippy#13185

Signed-off-by: Dat Tien Nguyen <phongtomfapp@gmail.com>
Signed-off-by: Dat Tien Nguyen <phongtomfapp@gmail.com>
Signed-off-by: Dat Tien Nguyen <phongtomfapp@gmail.com>
src/lib.rs Outdated
@@ -469,7 +469,7 @@ node.propose_conf_change(vec![], cc).unwrap();
This process is a two-phase process, during the midst of it the peer group's leader is managing
**two independent, possibly overlapping peer sets**.

> **Note:** In order to maintain resiliency guarantees (progress while a majority of both peer sets is
\> **Note:** In order to maintain resiliency guarantees (progress while a majority of both peer sets is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why escape this?

@@ -205,6 +205,7 @@ impl<'a> TestDataReader<'a> {
}
}

#[allow(clippy::manual_inspect)]
pub fn emit(&mut self, str: &str) {
self.rewrite_buffer.as_mut().map(|rb| {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing it with if let Some(rb) = &mut self.rewrite_buffer?

src/lib.rs Outdated
@@ -571,6 +571,7 @@ pub mod prelude {
///
/// Currently, this is a `log` adaptor behind a `Once` to ensure there is no clobbering.
#[cfg(any(test, feature = "default-logger"))]
#[allow(static_mut_refs)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using OnceLock to replace both LOGGER_INITIALIZED and LOGGER? static_mut_refs may be a hard error in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I have updated the PR.

Signed-off-by: Dat Tien Nguyen <phongtomfapp@gmail.com>
@BusyJay BusyJay merged commit dfe2239 into tikv:master Oct 20, 2024
6 checks passed
@BusyJay
Copy link
Member

BusyJay commented Oct 20, 2024

Thank you!

@datbeohbbh datbeohbbh deleted the fix/ci-clippy branch October 21, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants