mirror of
https://github.com/ClementTsang/bottom.git
synced 2026-05-05 22:40:46 +00:00
refactor: migrate to Rust 2024 edition (#1678)
* refactor: try bumping to rust 2024 edition * clippy
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user