mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 14:51:04 +02:00
refactor: fix some pedantic clippy warnings
This commit is contained in:
parent
4d30819ff6
commit
04f45ccae1
12 changed files with 43 additions and 46 deletions
17
src/main.rs
17
src/main.rs
|
@ -88,7 +88,7 @@ fn run_with_args() {
|
|||
match args.command {
|
||||
Some(command) => {
|
||||
if args.debug {
|
||||
eprintln!("REQUEST: {command:?}")
|
||||
eprintln!("REQUEST: {command:?}");
|
||||
}
|
||||
|
||||
let rt = create_runtime();
|
||||
|
@ -97,10 +97,10 @@ fn run_with_args() {
|
|||
match ipc.send(command, args.debug).await {
|
||||
Ok(res) => {
|
||||
if args.debug {
|
||||
eprintln!("RESPONSE: {res:?}")
|
||||
eprintln!("RESPONSE: {res:?}");
|
||||
}
|
||||
|
||||
cli::handle_response(res, args.format.unwrap_or_default())
|
||||
cli::handle_response(res, args.format.unwrap_or_default());
|
||||
}
|
||||
Err(err) => error!("{err:?}"),
|
||||
};
|
||||
|
@ -374,12 +374,11 @@ fn load_output_bars(
|
|||
let map = INDEX_MAP.get_or_init(|| Mutex::new(vec![]));
|
||||
|
||||
let index = lock!(map).iter().position(|n| n == monitor_name);
|
||||
let index = match index {
|
||||
Some(index) => index,
|
||||
None => {
|
||||
lock!(map).push(monitor_name.clone());
|
||||
lock!(map).len() - 1
|
||||
}
|
||||
let index = if let Some(index) = index {
|
||||
index
|
||||
} else {
|
||||
lock!(map).push(monitor_name.clone());
|
||||
lock!(map).len() - 1
|
||||
};
|
||||
|
||||
let config = ironbar.config.borrow();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue