Skip to content

Commit 640a9bd

Browse files
committed
fix clippy lints
1 parent 7e03472 commit 640a9bd

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎src/main.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use async_std::task::block_on;
22
use libc::{EXIT_FAILURE, EXIT_SUCCESS, SIGHUP, SIGQUIT};
33
use log::{debug, error, info, warn};
44
use std::sync::{Arc, LazyLock, atomic::AtomicBool};
5-
use std::{env, io, process::exit, path::PathBuf};
5+
use std::{env, io, path::PathBuf, process::exit};
66

77
use signal_hook::{consts::TERM_SIGNALS, flag, iterator::Signals, low_level::emulate_default_handler};
88

‎src/util/expand.rs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ pub fn expand_path(str: &str) -> PathBuf {
4949
continue;
5050
}
5151

52-
let end_idx = rest
53-
.chars()
54-
.position(|b| !is_valid_varname_char(b))
55-
.unwrap_or_else(|| rest.len());
52+
let end_idx = rest.chars().position(|b| !is_valid_varname_char(b)).unwrap_or(rest.len());
5653

5754
let varname = &rest[..end_idx];
5855

‎src/util/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub mod notify;
1212
/// Defined as: $XDG_CONFIG_PATH/mpdris/mpdris.conf or $HOME/.config/mpdris/mpdris.conf
1313
/// Deprecated path: $XDG_CONFIG_PATH/mpd/mpDris.conf or $HOME/.config/mpd/mpDris.conf
1414
pub fn get_config_path() -> PathBuf {
15-
let base = env::var_os("XDG_CONFIG_HOME").map_or_else(|| HOME_DIR.join(".config"), |p| PathBuf::from(p));
15+
let base = env::var_os("XDG_CONFIG_HOME").map_or_else(|| HOME_DIR.join(".config"), PathBuf::from);
1616
let paths = [base.join("mpdris/mpdris.conf"), base.join("mpd/mpDris.conf")];
1717
let idx = paths.iter().position(|p| p.is_file()).unwrap_or(0);
1818
if idx == 1 {

0 commit comments

Comments
 (0)