From 0be2c9cb8437e4e053f7410ca854dd06635e430f Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Wed, 4 Sep 2019 19:33:14 +0200 Subject: [PATCH] Remove warnings --- src/config.rs | 6 +++--- src/main.rs | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/config.rs b/src/config.rs index 77f4938..9f61385 100644 --- a/src/config.rs +++ b/src/config.rs @@ -14,7 +14,7 @@ pub struct Configs { impl Configs { pub fn load(path: &Path) -> Configs { - let mut file_res = File::open(path); + let file_res = File::open(path); if let Ok(mut file) = file_res { let mut contents = String::new(); file.read_to_string(&mut contents) @@ -35,7 +35,7 @@ impl Configs { // If config file does not exist, create one from template if !default_file.exists() { - fs::write(&default_file, default_config_file_content) + fs::write(&default_file, DEFAULT_CONFIG_FILE_CONTENT) .expect("Unable to write default config file"); } @@ -47,7 +47,7 @@ impl Configs { } // TODO: add documentation link -const default_config_file_content : &str = r###"# espanso configuration file +const DEFAULT_CONFIG_FILE_CONTENT : &str = r###"# espanso configuration file # This is the default configuration file, change it as you like it # You can refer to the official documentation: diff --git a/src/main.rs b/src/main.rs index a182c57..a36bb34 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,9 @@ use std::sync::mpsc; use crate::keyboard::KeyboardInterceptor; use crate::matcher::Matcher; -use crate::matcher::Match; use crate::matcher::scrolling::ScrollingMatcher; use crate::engine::Engine; use crate::config::Configs; -use std::path::Path; mod keyboard; mod matcher;