Fix clippy warnings in settings.rs
This commit is contained in:
parent
6b97273fcf
commit
d4cc060962
@ -16,7 +16,7 @@ fn main() -> Result<()> {
|
||||
let config = config::Config::load().ok();
|
||||
|
||||
// Resolve wallpaper settings
|
||||
let wallpaper_settings = settings::resolve_wallpaper(&args, config)?;
|
||||
let wallpaper_settings = settings::resolve_wallpaper(&args, config.as_ref())?;
|
||||
|
||||
// Connect to X11
|
||||
let session = x11::X11Session::connect()?;
|
||||
|
||||
@ -10,14 +10,14 @@ pub struct WallpaperSettings {
|
||||
|
||||
pub fn resolve_wallpaper(
|
||||
args: &args::Args,
|
||||
config: Option<config::Config>,
|
||||
config: Option<&config::Config>,
|
||||
) -> Result<WallpaperSettings> {
|
||||
// Borrow the config once as `Option<&Config>`.
|
||||
//
|
||||
// Avoids moving `config`, allows to:
|
||||
// - read values multiple times
|
||||
// - decide later whether we need to write a new config
|
||||
let cfg = config.as_ref();
|
||||
let cfg = config;
|
||||
|
||||
// Resolve wallpaper image path by precedence:
|
||||
// 1. args (`--set`, `--update`): Use path from args.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user