diff --git a/apps/oxlint/src/lint.rs b/apps/oxlint/src/lint.rs index 2d9df1d1c92ad..c65958c7ffd84 100644 --- a/apps/oxlint/src/lint.rs +++ b/apps/oxlint/src/lint.rs @@ -321,14 +321,14 @@ impl LintRunner { // Spawn linting in another thread so diagnostics can be printed immediately from diagnostic_service.run. rayon::spawn(move || { let mut lint_service = LintService::new(linter, allocator_pool, options); - let _ = lint_service.with_paths(paths); + lint_service.with_paths(paths); // Use `RawTransferFileSystem` if `oxlint2` feature is enabled. // This reads the source text into start of allocator, instead of the end. #[cfg(all(feature = "oxlint2", not(feature = "disable_oxlint2")))] { use crate::raw_fs::RawTransferFileSystem; - let _ = lint_service.with_file_system(Box::new(RawTransferFileSystem)); + lint_service.with_file_system(Box::new(RawTransferFileSystem)); } lint_service.run(&tx_error); diff --git a/crates/oxc_linter/src/service/mod.rs b/crates/oxc_linter/src/service/mod.rs index 3cb4fbc79abe5..9c9833b7c5de0 100644 --- a/crates/oxc_linter/src/service/mod.rs +++ b/crates/oxc_linter/src/service/mod.rs @@ -75,7 +75,6 @@ impl LintService { Self { runtime } } - #[must_use] pub fn with_file_system( &mut self, file_system: Box, @@ -84,7 +83,6 @@ impl LintService { self } - #[must_use] pub fn with_paths(&mut self, paths: Vec>) -> &mut Self { self.runtime.with_paths(paths); self diff --git a/crates/oxc_linter/src/service/runtime.rs b/crates/oxc_linter/src/service/runtime.rs index 172f5bfeac89d..3c07fa337925a 100644 --- a/crates/oxc_linter/src/service/runtime.rs +++ b/crates/oxc_linter/src/service/runtime.rs @@ -195,12 +195,12 @@ impl Runtime { pub fn with_file_system( &mut self, file_system: Box, - ) -> &Self { + ) -> &mut Self { self.file_system = file_system; self } - pub fn with_paths(&mut self, paths: Vec>) -> &Self { + pub fn with_paths(&mut self, paths: Vec>) -> &mut Self { self.paths = paths.into_iter().collect(); self } diff --git a/crates/oxc_linter/src/tester.rs b/crates/oxc_linter/src/tester.rs index a6bd03fcbfdd2..2f5b2696c7b83 100644 --- a/crates/oxc_linter/src/tester.rs +++ b/crates/oxc_linter/src/tester.rs @@ -545,7 +545,7 @@ impl Tester { let paths = vec![Arc::::from(path_to_lint.as_os_str())]; let options = LintServiceOptions::new(cwd).with_cross_module(self.plugins.has_import()); let mut lint_service = LintService::new(linter, AllocatorPool::default(), options); - let _ = lint_service + lint_service .with_file_system(Box::new(TesterFileSystem::new( path_to_lint, source_text.to_string(),