refactor: fix clippy::pedantic lints

This commit is contained in:
Harsh Shandilya 2022-05-01 19:03:22 +05:30
parent 51b547f73b
commit 7274d8acb2
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
2 changed files with 4 additions and 4 deletions

View file

@ -46,8 +46,8 @@ fn truncate(s: &str, max_chars: usize) -> &str {
} }
} }
pub fn monitor_clipboard<'a>(config: Replacements<'_>) { pub fn monitor(config: Replacements<'_>) {
let ctx = ClipboardContext::new().expect("Failed to acquire clipboard"); let ctx = ClipboardContext::new().expect("Failed to acquire clipboard");
let handler = Handler { ctx, config }; let handler = Handler { ctx, config };
let _ = Master::new(handler).run(); let _master = Master::new(handler).run();
} }

View file

@ -8,7 +8,7 @@ use std::path::PathBuf;
use anyhow::{anyhow, Result}; use anyhow::{anyhow, Result};
use dirs::config_dir; use dirs::config_dir;
use crate::clipboard::monitor_clipboard; use crate::clipboard::monitor;
use crate::config::Replacements; use crate::config::Replacements;
fn main() -> Result<()> { fn main() -> Result<()> {
@ -20,7 +20,7 @@ fn main() -> Result<()> {
let config_str = let config_str =
std::fs::read_to_string(config_path.as_path()).unwrap_or_default(); std::fs::read_to_string(config_path.as_path()).unwrap_or_default();
let config: Replacements<'_> = toml::from_str(&config_str)?; let config: Replacements<'_> = toml::from_str(&config_str)?;
monitor_clipboard(config); monitor(config);
Ok(()) Ok(())
} }