Skip to content

Commit

Permalink
[#98] Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
orecham committed May 22, 2024
1 parent 896f6d5 commit 3e3ed63
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions iceoryx2-cli/iox2/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@ pub fn list() {
.iter()
.map(|command| {
format!(
" {}",
format!(
"{} {}",
command.name.bold(),
if command.is_development {
"(dev) ".italic()
} else {
"".italic()
},
)
" {} {}",
command.name.bold(),
if command.is_development {
"(dev) ".italic()
} else {
"".italic()
},
)
})
.for_each(|formatted_command| println!("{}", formatted_command));
Expand Down Expand Up @@ -94,7 +91,7 @@ fn find_development_command_binaries() -> Vec<CommandInfo> {
.into_iter()
.flat_map(|entries| entries.filter_map(Result::ok))
.map(|entry| entry.path())
.filter(|path| is_valid_command_binary(path))
.filter(is_valid_command_binary)
.filter_map(|path| {
path.file_name()
.and_then(|n| n.to_str())
Expand All @@ -112,7 +109,6 @@ fn find_development_command_binaries() -> Vec<CommandInfo> {

fn find_installed_command_binaries() -> Vec<CommandInfo> {
get_installed_binaries_dirs()
.into_iter()
.flat_map(|path: PathBuf| {
fs::read_dir(path)
.into_iter()
Expand Down Expand Up @@ -173,9 +169,9 @@ pub fn execute_external_command(
) -> Result<(), ExecutionError> {
let available_commands = find();
if let Some(command_info) = available_commands.into_iter().find(|c| {
&c.name == command_name
c.name == command_name
&& if dev_flag_present {
c.is_development == true
c.is_development
} else {
if c.is_development {
println!(
Expand Down

0 comments on commit 3e3ed63

Please sign in to comment.