From 95f556a9185e31d2ea83ae7d69501b0db5ae5622 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 25 Jul 2024 13:40:48 -0500 Subject: [PATCH] refactor(config): Be more direct --- crates/typos-cli/src/config.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/typos-cli/src/config.rs b/crates/typos-cli/src/config.rs index 19e3b552c..577b9909a 100644 --- a/crates/typos-cli/src/config.rs +++ b/crates/typos-cli/src/config.rs @@ -60,12 +60,12 @@ impl Config { if path.file_name().unwrap() == PYPROJECT_TOML { let config = toml::from_str::(&s)?; - if config.tool.typos.is_none() { + if let Some(typos) = config.tool.typos { + Ok(Some(typos)) + } else { log::debug!("No `tool.typos` section found in `{PYPROJECT_TOML}`, skipping"); Ok(None) - } else { - Ok(config.tool.typos) } } else { Self::from_toml(&s).map(Some)