Fix clippy lints

This commit is contained in:
Yash Karandikar 2022-07-03 11:38:33 +05:30
parent 2aac4731dd
commit 0832dacd1b
2 changed files with 7 additions and 5 deletions

View file

@ -31,10 +31,12 @@ pub fn load_file() -> XcrabConfig {
let home_dir = std::env::var("HOME").expect("Error: $HOME variable was not set");
let contents = std::fs::read_to_string(format!("{}/.config/xcrab/config.toml", home_dir))
.expect(&format!(
"Error: file {}/.config/xcrab/config.toml was not found",
home_dir
));
.unwrap_or_else(|_| {
panic!(
"Error: file {}/.config/xcrab/config.toml was not found",
home_dir
)
});
let config: XcrabConfig = toml::from_str(&contents)
.expect("Error: config file was not parseable. Is it properly formatted?");

View file

@ -42,7 +42,7 @@ pub async fn listener_task(socket_path: &Path, sender: UnboundedSender<String>)
stream.read_to_string(&mut buf).await?;
let _ = sender.send(buf);
drop(sender.send(buf)); // go back to ms word clippy
}
}