diff --git a/src/main.rs b/src/main.rs index 37caffa995..1ef8f30db2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -183,7 +183,7 @@ fn inner_main() -> Result { set_up_logging(cli.verbose)?; - let mut settings = Settings::from_paths(&cli.files)?; + let mut settings = Settings::from_paths(&cli.files); if !cli.select.is_empty() { settings.select(cli.select); } diff --git a/src/settings.rs b/src/settings.rs index e5b8793ba8..efcf6cb152 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -2,7 +2,6 @@ use std::collections::BTreeSet; use std::hash::{Hash, Hasher}; use std::path::PathBuf; -use anyhow::Result; use glob::Pattern; use crate::checks::CheckCode; @@ -25,7 +24,7 @@ impl Hash for Settings { } impl Settings { - pub fn from_paths(paths: &[PathBuf]) -> Result { + pub fn from_paths(paths: &[PathBuf]) -> Self { let (project_root, config) = load_config(paths); let mut settings = Settings { line_length: config.line_length.unwrap_or(88), @@ -89,7 +88,7 @@ impl Settings { if let Some(ignore) = &config.ignore { settings.ignore(ignore); } - Ok(settings) + settings } pub fn select(&mut self, codes: Vec) {