Skip to content

Commit c818c39

Browse files
committed
u
1 parent b0aa5f6 commit c818c39

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

apps/oxlint/src/lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl Runner for LintRunner {
186186
// e.g. `/some/file.js` and `/some/other/file.js` would both result in `/some`
187187
let mut directories = FxHashSet::default();
188188
for path in &paths {
189-
let path = Path::new(path.as_ref());
189+
let path = Path::new(path);
190190
if let Some(directory) = path.parent() {
191191
// NOTE: Initial benchmarking showed that it was faster to iterate over the directories twice
192192
// rather than constructing the configs in one iteration. It's worth re-benchmarking that though.

crates/oxc_linter/src/service/runtime.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ struct ModuleToLint {
112112
}
113113
impl ModuleToLint {
114114
fn from_processed_module(path: Arc<OsStr>, processed_module: ProcessedModule) -> Option<Self> {
115-
let content = processed_module.content?;
116-
Some(Self {
115+
processed_module.content.map(|content| Self {
117116
path,
118117
section_module_records: processed_module
119118
.section_module_records
@@ -135,7 +134,6 @@ impl Runtime {
135134
paths: options.paths.iter().cloned().collect(),
136135
linter,
137136
resolver,
138-
139137
#[cfg(test)]
140138
test_source: std::sync::RwLock::new(None),
141139
}
@@ -279,7 +277,7 @@ impl Runtime {
279277
let mut module_paths_and_resolved_requests =
280278
Vec::<(Arc<OsStr>, SmallVec<[Vec<ResolvedModuleRequest>; 1]>)>::new();
281279

282-
// There are two kinds of threads. Let's call them the graph thread and module threads.
280+
// There are two sets of threads: threads for the graph and threads for the modules.
283281
// - The graph thread is the one thread that calls `resolve_modules`. It's the only thread that updates the module graph, so no need for locks.
284282
// - Module threads accept paths and produces `ModuleProcessOutput` (the logic is in `self.process_path`). They are isolated to each
285283
// other and paralleled in the rayon thread pool.

0 commit comments

Comments
 (0)