Fix clippy warnings in settings.rs

This commit is contained in:
Candifloss 2025-12-20 19:32:24 +05:30
parent 6b97273fcf
commit d4cc060962
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ fn main() -> Result<()> {
let config = config::Config::load().ok(); let config = config::Config::load().ok();
// Resolve wallpaper settings // Resolve wallpaper settings
let wallpaper_settings = settings::resolve_wallpaper(&args, config)?; let wallpaper_settings = settings::resolve_wallpaper(&args, config.as_ref())?;
// Connect to X11 // Connect to X11
let session = x11::X11Session::connect()?; let session = x11::X11Session::connect()?;

View File

@ -10,14 +10,14 @@ pub struct WallpaperSettings {
pub fn resolve_wallpaper( pub fn resolve_wallpaper(
args: &args::Args, args: &args::Args,
config: Option<config::Config>, config: Option<&config::Config>,
) -> Result<WallpaperSettings> { ) -> Result<WallpaperSettings> {
// Borrow the config once as `Option<&Config>`. // Borrow the config once as `Option<&Config>`.
// //
// Avoids moving `config`, allows to: // Avoids moving `config`, allows to:
// - read values multiple times // - read values multiple times
// - decide later whether we need to write a new config // - decide later whether we need to write a new config
let cfg = config.as_ref(); let cfg = config;
// Resolve wallpaper image path by precedence: // Resolve wallpaper image path by precedence:
// 1. args (`--set`, `--update`): Use path from args. // 1. args (`--set`, `--update`): Use path from args.