Skip to content

Commit

Permalink
chore: Rust 1.84 linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Jan 9, 2025
1 parent bc47e2f commit 3065265
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/app_data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,12 @@ impl AppData {
fn set_sorted(&mut self, x: Option<(Header, SortedOrder)>) {
self.sorted_by = x;
self.sort_containers();
self.containers
.state
.select(self.containers.items.iter().position(|i| {
self.get_selected_container_id()
.map_or(false, |id| i.id == id)
}));
self.containers.state.select(
self.containers
.items
.iter()
.position(|i| self.get_selected_container_id().as_ref() == Some(&i.id)),
);
}

/// Remove the sorted header & order, and sort by default - created datetime
Expand Down Expand Up @@ -676,13 +676,13 @@ impl AppData {
/// So that can disallow commands to be send
/// Is a shabby way of implementing this
pub fn is_oxker(&self) -> bool {
self.get_selected_container().map_or(false, |i| i.is_oxker)
self.get_selected_container().is_some_and(|i| i.is_oxker)
}

/// Check if selected container is oxker and also that oxker is being run in a container
pub fn is_oxker_in_container(&self) -> bool {
self.get_selected_container()
.map_or(false, |i| i.is_oxker && self.args.in_container)
.is_some_and(|i| i.is_oxker && self.args.in_container)
}

/// Find the widths for the strings in the containers panel.
Expand Down Expand Up @@ -817,7 +817,7 @@ impl AppData {
let is_oxker = i
.command
.as_ref()
.map_or(false, |i| i.starts_with(ENTRY_POINT));
.is_some_and(|i| i.starts_with(ENTRY_POINT));

let status = ContainerStatus::from(
i.status
Expand Down
2 changes: 1 addition & 1 deletion src/docker_data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl DockerData {
if self.args.in_container
&& f.command
.as_ref()
.map_or(false, |c| c.starts_with(ENTRY_POINT))
.is_some_and(|c| c.starts_with(ENTRY_POINT))
&& self.args.show_self
{
None
Expand Down
2 changes: 1 addition & 1 deletion src/parse_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl CliArgs {
/// An ENV is set in the ./containerised/Dockerfile, if this is ENV found, then sleep for 250ms, else the container, for as yet unknown reasons, will close immediately
/// returns a bool, so that the `update_all_containers()` won't bother to check the entry point unless running via a container
fn check_if_in_container() -> bool {
std::env::var(ENV_KEY).map_or(false, |i| i == ENV_VALUE)
std::env::var(ENV_KEY).is_ok_and(|i| i == ENV_VALUE)
}

/// Parse cli arguments
Expand Down

0 comments on commit 3065265

Please # to comment.