Skip to content

Commit 6f9c0c8

Browse files
refactor(turborepo-updater): chain environment variable iterators in should_skip_notification (#10622)
## Description Optimizes the `should_skip_notification()` function by combining two separate environment variable checks into a single chained iterator operation. ### Changes - **Before**: Two separate `.any()` calls on `NOTIFIER_DISABLE_VARS` and `ENVIRONMENTAL_DISABLE_VARS` - **After**: Single chained iterator using `.chain()` method ### Benefits - **Improved readability**: Cleaner, more idiomatic Rust code - **Reduced redundancy**: Eliminates duplicate iteration logic - **Better maintainability**: Follows Rust iterator best practices - **Same functionality**: Zero behavioral changes
1 parent 4630c45 commit 6f9c0c8

File tree

1 file changed

+1
-3
lines changed
  • crates/turborepo-updater/src

1 file changed

+1
-3
lines changed

crates/turborepo-updater/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ fn get_tag_from_version(pre: &semver::Prerelease) -> VersionTag {
9090
fn should_skip_notification() -> bool {
9191
NOTIFIER_DISABLE_VARS
9292
.iter()
93+
.chain(ENVIRONMENTAL_DISABLE_VARS.iter())
9394
.any(|var| std::env::var(var).is_ok())
94-
|| ENVIRONMENTAL_DISABLE_VARS
95-
.iter()
96-
.any(|var| std::env::var(var).is_ok())
9795
|| !atty::is(atty::Stream::Stdout)
9896
}
9997

0 commit comments

Comments
 (0)