Skip to content

Commit a6369f5

Browse files
branchseerclaude
andcommitted
refactor: remove ResolvedInputConfig::inference_disabled method
The public field `includes_auto` is clear enough on its own; the negated helper added indirection without value. Remove it and use `!includes_auto` directly. Drop redundant test assertions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8ce4762 commit a6369f5

2 files changed

Lines changed: 3 additions & 17 deletions

File tree

crates/vite_task/src/session/execute/fingerprint.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ impl PostRunFingerprint {
7777
/// * `input_config` - Resolved input configuration controlling what to fingerprint
7878
#[tracing::instrument(level = "debug", skip_all, name = "create_post_run_fingerprint")]
7979
pub fn create(
80-
path_reads: &HashMap<RelativePathBuf, PathRead>,
80+
inferred_path_reads: &HashMap<RelativePathBuf, PathRead>,
8181
base_dir: &AbsolutePath,
8282
glob_base: &AbsolutePath,
8383
input_config: &ResolvedInputConfig,
8484
) -> anyhow::Result<Self> {
8585
// If inference is disabled, return empty inferred_inputs
86-
if input_config.inference_disabled() {
86+
if !input_config.includes_auto {
8787
return Ok(Self { inferred_inputs: HashMap::default() });
8888
}
8989

@@ -93,7 +93,7 @@ impl PostRunFingerprint {
9393
.map(|p| ResolvedGlob::new(p.as_str(), glob_base))
9494
.collect::<anyhow::Result<_>>()?;
9595

96-
let inferred_inputs = path_reads
96+
let inferred_inputs = inferred_path_reads
9797
.par_iter()
9898
.filter_map(|(relative_path, path_read)| {
9999
// Clean the absolute path to normalize `..` from fspy-tracked paths

crates/vite_task_graph/src/config/mod.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,6 @@ impl ResolvedInputConfig {
150150

151151
Self { includes_auto, positive_globs, negative_globs }
152152
}
153-
154-
/// Returns true if inference should be disabled.
155-
///
156-
/// Inference is disabled when `includes_auto` is false.
157-
#[inline]
158-
#[must_use]
159-
pub const fn inference_disabled(&self) -> bool {
160-
!self.includes_auto
161-
}
162153
}
163154

164155
#[derive(Debug, Clone, Serialize)]
@@ -295,7 +286,6 @@ mod tests {
295286
assert!(config.includes_auto);
296287
assert!(config.positive_globs.is_empty());
297288
assert!(config.negative_globs.is_empty());
298-
assert!(!config.inference_disabled());
299289
}
300290

301291
#[test]
@@ -315,7 +305,6 @@ mod tests {
315305
assert!(!config.includes_auto);
316306
assert!(config.positive_globs.is_empty());
317307
assert!(config.negative_globs.is_empty());
318-
assert!(config.inference_disabled());
319308
}
320309

321310
#[test]
@@ -349,7 +338,6 @@ mod tests {
349338
assert!(config.positive_globs.contains("src/**/*.ts"));
350339
assert!(config.positive_globs.contains("package.json"));
351340
assert!(config.negative_globs.is_empty());
352-
assert!(config.inference_disabled());
353341
}
354342

355343
#[test]
@@ -379,7 +367,6 @@ mod tests {
379367
assert!(config.positive_globs.contains("package.json"));
380368
assert_eq!(config.negative_globs.len(), 1);
381369
assert!(config.negative_globs.contains("node_modules/**"));
382-
assert!(!config.inference_disabled());
383370
}
384371

385372
#[test]
@@ -389,6 +376,5 @@ mod tests {
389376
vec![UserInputEntry::Glob("src/**/*.ts".into()), UserInputEntry::Auto { auto: true }];
390377
let config = ResolvedInputConfig::from_user_config(Some(&user_inputs));
391378
assert!(config.includes_auto);
392-
assert!(!config.inference_disabled());
393379
}
394380
}

0 commit comments

Comments
 (0)