Skip to content

Commit 91518ce

Browse files
committed
Fix gsqz clippy on release stack (#202)
1 parent e5b4e84 commit 91518ce

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

crates/gsqz/src/main.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,18 @@ fn main() {
7171
let config = Config::load(cli.config.as_deref());
7272

7373
// Auto-export default config to ~/.gobby/gsqz.yaml on first run (creates ~/.gobby/ if needed)
74-
if cli.config.is_none() && !cli.init {
75-
if let Some(home) = dirs::home_dir() {
76-
let global_dir = home.join(".gobby");
77-
let global_config = global_dir.join("gsqz.yaml");
78-
if !global_config.exists() {
79-
let _ = std::fs::create_dir_all(&global_dir);
80-
if let Err(e) = std::fs::write(&global_config, config::DEFAULT_CONFIG_YAML) {
81-
eprintln!("Warning: failed to write {}: {e}", global_config.display());
82-
} else {
83-
eprintln!("Created ~/.gobby/gsqz.yaml with default config.");
84-
}
74+
if cli.config.is_none()
75+
&& !cli.init
76+
&& let Some(home) = dirs::home_dir()
77+
{
78+
let global_dir = home.join(".gobby");
79+
let global_config = global_dir.join("gsqz.yaml");
80+
if !global_config.exists() {
81+
let _ = std::fs::create_dir_all(&global_dir);
82+
if let Err(e) = std::fs::write(&global_config, config::DEFAULT_CONFIG_YAML) {
83+
eprintln!("Warning: failed to write {}: {e}", global_config.display());
84+
} else {
85+
eprintln!("Created ~/.gobby/gsqz.yaml with default config.");
8586
}
8687
}
8788
}

crates/gsqz/src/primitives/match_output.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ pub fn check(lines: &[String], rules: &[MatchOutputRule]) -> Option<String> {
1919
}
2020

2121
// Check unless pattern — if it matches, this rule doesn't fire
22-
if let Some(ref unless) = rule.unless {
23-
if let Ok(unless_re) = Regex::new(unless) {
24-
if unless_re.is_match(&blob) {
25-
continue;
26-
}
27-
}
22+
if let Some(ref unless) = rule.unless
23+
&& let Ok(unless_re) = Regex::new(unless)
24+
&& unless_re.is_match(&blob)
25+
{
26+
continue;
2827
}
2928

3029
return Some(rule.message.clone());

0 commit comments

Comments
 (0)