mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-02-22 06:43:41 +00:00
libs: Fix clippy legacy_numeric_constants
Fix `legacy_numeric_constants` clippy warning as suggested by rust
1.85.1, since `mem-agent` is now a member of `libs` workspace.
```console
error: usage of a legacy numeric constant
--> mem-agent/src/compact.rs:132:47
|
132 | if self.config.compact_force_times == std::u64::MAX {
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
132 | if self.config.compact_force_times == u64::MAX {
| ~~~~~~~~
```
Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
@@ -63,7 +63,7 @@ impl Default for Config {
|
||||
compact_sec_max: 5 * 60,
|
||||
compact_order: PAGE_REPORTING_MIN_ORDER,
|
||||
compact_threshold: 2 << PAGE_REPORTING_MIN_ORDER,
|
||||
compact_force_times: std::u64::MAX,
|
||||
compact_force_times: u64::MAX,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ impl CompactCore {
|
||||
}
|
||||
|
||||
fn need_force_compact(&self) -> bool {
|
||||
if self.config.compact_force_times == std::u64::MAX {
|
||||
if self.config.compact_force_times == u64::MAX {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user