chore: Rust 1.86.0 linting

This commit is contained in:
Jack Wills
2025-04-14 11:47:00 +00:00
parent 997eebca20
commit 9acf60334c
8 changed files with 23 additions and 21 deletions
+3 -3
View File
@@ -481,7 +481,7 @@ impl ByteStats {
pub const fn new(value: u64) -> Self {
Self(value)
}
pub fn update(&mut self, value: u64) {
pub const fn update(&mut self, value: u64) {
self.0 = value;
}
}
@@ -567,7 +567,7 @@ impl Logs {
pub fn insert(&mut self, line: ListItem<'static>, tz: LogsTz) {
if self.tz.insert(tz) {
self.logs.items.push(line);
};
}
}
pub fn to_vec(&self) -> Vec<ListItem<'static>> {
@@ -598,7 +598,7 @@ impl Logs {
self.logs.items.len()
}
pub fn state(&mut self) -> &mut ListState {
pub const fn state(&mut self) -> &mut ListState {
&mut self.logs.state
}
}
+10 -8
View File
@@ -237,7 +237,7 @@ impl AppData {
term.push(c);
} else {
self.filter.term = Some(format!("{c}"));
};
}
self.filter_containers();
}
@@ -275,7 +275,7 @@ impl AppData {
while let Some(i) = self.hidden_containers.pop() {
if self.get_container_by_id(&i.id).is_none() {
self.containers.items.push(i);
};
}
}
self.sort_containers();
}
@@ -420,6 +420,8 @@ impl AppData {
}
/// Get all the ContainerItems
/// Thnk this allow block can be removed with the 1.87 release of Clippy
#[allow(clippy::missing_const_for_fn)]
pub fn get_container_items(&self) -> &[ContainerItem] {
&self.containers.items
}
@@ -459,7 +461,7 @@ impl AppData {
}
/// Get ListState of containers
pub fn get_container_state(&mut self) -> &mut ListState {
pub const fn get_container_state(&mut self) -> &mut ListState {
&mut self.containers.state
}
@@ -886,10 +888,10 @@ impl AppData {
if let Some(item) = self.get_any_container_by_id(&id) {
if item.name.get() != name {
item.name.set(name);
};
}
if item.status != status {
item.status = status;
};
}
if item.state != state {
item.docker_controls.items = DockerCommand::gen_vec(state);
// Update the list state, needs to be None if the gen_vec returns an empty vec
@@ -898,15 +900,15 @@ impl AppData {
item.docker_controls.state.select(None);
}
_ => item.docker_controls.start(),
};
}
item.state = state;
};
}
item.ports = ports;
if item.image.get() != image {
item.image.set(image);
};
}
} else {
// container not known, so make new ContainerItem and push into containers Ve
let container = ContainerItem::new(