diff --git a/src/cmd_line.rs b/src/cmd_line.rs index 45f91db..7d6f302 100644 --- a/src/cmd_line.rs +++ b/src/cmd_line.rs @@ -23,7 +23,7 @@ along with this program. If not, see . use std::path::PathBuf; use bpaf::Bpaf; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; /// Generate pre-populated module files formatted with AsciiDoc that are used in Red Hat and Fedora documentation. #[derive(Clone, Debug, Bpaf, Default)] diff --git a/src/config.rs b/src/config.rs index 49dd9c5..9cd35de 100644 --- a/src/config.rs +++ b/src/config.rs @@ -25,8 +25,11 @@ use std::path::PathBuf; use color_eyre::eyre::{Result, WrapErr}; use directories::ProjectDirs; -use figment::{Figment, providers::{Format, Toml, Serialized}}; -use serde::{Serialize, Deserialize}; +use figment::{ + providers::{Format, Serialized, Toml}, + Figment, +}; +use serde::{Deserialize, Serialize}; use crate::cmd_line::{Cli, Comments, Verbosity}; @@ -118,11 +121,7 @@ impl Default for Options { /// with a dot at the start, such as `.newdoc.toml`, or /// a regular, visible file, such as `newdoc.toml`. fn config_file_name(hidden: bool) -> String { - let prefix = if hidden { - "." - } else { - "" - }; + let prefix = if hidden { "." } else { "" }; format!("{prefix}{PKG_NAME}.toml") } @@ -170,12 +169,14 @@ pub fn merge_configs(cli_options: Options) -> Result { if let Some(git_conf_file) = git_conf_file(&cli_options) { log::info!("Git repo configuration file: {}", git_conf_file.display()); - figment = figment.merge(Toml::file(git_conf_file)); + figment = figment.merge(Toml::file(git_conf_file)); } log::debug!("Figment configuration: {figment:#?}"); - let mut conf_options: Options = figment.extract().wrap_err("Failed to load configuration files.")?; + let mut conf_options: Options = figment + .extract() + .wrap_err("Failed to load configuration files.")?; conf_options.update_from_non_default(&cli_options); diff --git a/src/lib.rs b/src/lib.rs index 3c8ecf5..e1f5ed9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,7 +51,6 @@ pub use module::{ContentType, Input, Module}; /// error message through `expect`. const REGEX_ERROR: &str = "Failed to construct a regular expression. Please report this as a bug"; - pub fn run(options: &Options, cli: &Cli) -> Result<()> { log::debug!("Active options:\n{:#?}", &options);