diff --git a/src/disk.rs b/src/disk.rs index 60d133b..175d679 100644 --- a/src/disk.rs +++ b/src/disk.rs @@ -16,11 +16,8 @@ pub fn save_file(file_name: &str, content: &[u8], path: &Option) { }; if let Some(parent) = path.parent() { - match fs::create_dir_all(parent) { - Err(err) => { - error!("Couldn't create folder {}: {}", parent.display(), err); - } - Ok(()) => (), + if let Err(err) = fs::create_dir_all(parent) { + error!("Couldn't create folder {}: {}", parent.display(), err); } } diff --git a/src/scraper.rs b/src/scraper.rs index a398eee..0e49c80 100644 --- a/src/scraper.rs +++ b/src/scraper.rs @@ -176,7 +176,7 @@ impl Scraper { Vec::from(data) }; - let dom = dom::Dom::new(&String::from_utf8_lossy(&utf8_data).into_owned()); + let dom = dom::Dom::new(&String::from_utf8_lossy(&utf8_data)); let source_path = match scraper.path_map.lock().unwrap().get(url.as_str()) { Some(path) => path.clone(), None => error!("Url {} was not found in the path map", url.as_str()),