浏览代码

config: Fix some clippy warnings

Johannes Hofmann 8 年前
父节点
当前提交
bce8b799c7
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      src/config.rs

+ 2
- 2
src/config.rs 查看文件

27
                 if let Ok(path) = xdg_dirs.place_config_file("config.toml") {
27
                 if let Ok(path) = xdg_dirs.place_config_file("config.toml") {
28
                     if let Ok(mut file) = File::create(&path) {
28
                     if let Ok(mut file) = File::create(&path) {
29
                         println!("write default config {:?}", &path);
29
                         println!("write default config {:?}", &path);
30
-                        file.write_all(DEFAULT_CONFIG.as_bytes());
30
+                        let _ = file.write_all(DEFAULT_CONFIG.as_bytes());
31
                     }
31
                     }
32
                 }
32
                 }
33
 
33
 
95
                         .as_str()
95
                         .as_str()
96
                         .ok_or_else(|| "extension has to be a string".to_string())?;
96
                         .ok_or_else(|| "extension has to be a string".to_string())?;
97
 
97
 
98
-                    if name.contains("/") || name.contains("\\") {
98
+                    if name.contains('/') || name.contains('\\') {
99
                         return Err(format!("source name ({:?}) must not contain slashes (\"/\" or \"\\\")", name));
99
                         return Err(format!("source name ({:?}) must not contain slashes (\"/\" or \"\\\")", name));
100
                     }
100
                     }
101
 
101