refactor: migrate to Rust 2024 edition (#1678)

* refactor: try bumping to rust 2024 edition

* clippy
This commit is contained in:
Clement Tsang
2025-12-25 01:17:41 -05:00
committed by GitHub
parent 8da4a84ea8
commit b07eb646ce
4 changed files with 7 additions and 12 deletions
+2 -2
View File
@@ -38,9 +38,9 @@ exclude = [
"profile.json.gz",
"rustfmt.toml",
]
edition = "2021"
edition = "2024"
# The oldest version I've tested that should still build - note this is not an official MSRV!
rust-version = "1.81"
rust-version = "1.85"
[lib]
test = true
+2 -4
View File
@@ -196,13 +196,11 @@ fn create_dataset(data: GraphData<'_>) -> Dataset<'_> {
.data(time, values)
.graph_type(GraphType::Line);
let dataset = if let Some(name) = name {
if let Some(name) = name {
dataset.name(name)
} else {
dataset
};
dataset
}
}
#[cfg(test)]
+1 -2
View File
@@ -288,8 +288,7 @@ impl Painter {
f.render_widget(
Table::new(
total_network,
&((std::iter::repeat(draw_loc.width.saturating_sub(2) / 4))
.take(4)
&((std::iter::repeat_n(draw_loc.width.saturating_sub(2) / 4, 4))
.map(Constraint::Length)
.collect::<Vec<_>>()),
)
+2 -4
View File
@@ -756,13 +756,11 @@ fn get_default_cpu_selection(args: &BottomArgs, config: &Config) -> config::cpu:
}
fn get_dedicated_avg_row(config: &Config) -> bool {
let conf = config
config
.flags
.as_ref()
.and_then(|flags| flags.average_cpu_row)
.unwrap_or(false);
conf
.unwrap_or(false)
}
#[inline]