Skip to content

Commit dc30c0e

Browse files
committed
remove get_globs in favor of get_normalized_sources
1 parent 61b4455 commit dc30c0e

File tree

4 files changed

+1
-272
lines changed

4 files changed

+1
-272
lines changed

crates/node/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl Scanner {
169169
pub fn globs(&mut self) -> Vec<GlobEntry> {
170170
self
171171
.scanner
172-
.get_globs()
172+
.get_normalized_sources()
173173
.into_iter()
174174
.map(Into::into)
175175
.collect()

crates/oxide/src/scanner/detect_sources.rs

Lines changed: 0 additions & 149 deletions
This file was deleted.

crates/oxide/src/scanner/mod.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
pub mod auto_source_detection;
2-
pub mod detect_sources;
32
pub mod sources;
43

54
use crate::extractor::{Extracted, Extractor};
6-
use crate::glob::optimize_patterns;
7-
use crate::scanner::detect_sources::resolve_globs;
85
use crate::scanner::sources::{
96
public_source_entries_to_private_source_entries, PublicSourceEntry, SourceEntry, Sources,
107
};
@@ -92,9 +89,6 @@ pub struct Scanner {
9289
/// All directories, sub-directories, etc… we saw during source detection
9390
dirs: Vec<PathBuf>,
9491

95-
/// All generated globs, used for setting up watchers
96-
globs: Vec<GlobEntry>,
97-
9892
/// Track unique set of candidates
9993
candidates: FxHashSet<String>,
10094
}
@@ -294,32 +288,6 @@ impl Scanner {
294288
.collect()
295289
}
296290

297-
#[tracing::instrument(skip_all)]
298-
pub fn get_globs(&mut self) -> Vec<GlobEntry> {
299-
self.scan_sources();
300-
301-
for source in self.sources.iter() {
302-
match source {
303-
SourceEntry::Auto { base } | SourceEntry::External { base } => {
304-
let globs = resolve_globs((base).to_path_buf(), &self.dirs, &self.extensions);
305-
self.globs.extend(globs);
306-
}
307-
SourceEntry::Pattern { base, pattern } => {
308-
self.globs.push(GlobEntry {
309-
base: base.to_string_lossy().to_string(),
310-
pattern: pattern.to_string(),
311-
});
312-
}
313-
_ => {}
314-
}
315-
}
316-
317-
// Re-optimize the globs to reduce the number of patterns we have to scan.
318-
self.globs = optimize_patterns(&self.globs);
319-
320-
self.globs.clone()
321-
}
322-
323291
#[tracing::instrument(skip_all)]
324292
pub fn get_normalized_sources(&mut self) -> Vec<GlobEntry> {
325293
self.sources

0 commit comments

Comments
 (0)