diff --git a/crates/oxc_resolver/src/cache.rs b/crates/oxc_resolver/src/cache.rs index 8626d8932..a107560ec 100644 --- a/crates/oxc_resolver/src/cache.rs +++ b/crates/oxc_resolver/src/cache.rs @@ -25,7 +25,7 @@ pub struct Cache { tsconfigs: DashMap, BuildHasherDefault>, } -impl Cache { +impl Cache { pub fn new(fs: Fs) -> Self { Self { fs, ..Self::default() } } @@ -215,7 +215,7 @@ impl CachedPathImpl { .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) } - pub fn module_directory( + pub fn module_directory( &self, module_name: &str, cache: &Cache, @@ -224,7 +224,10 @@ impl CachedPathImpl { cached_path.is_dir(&cache.fs).then(|| cached_path) } - pub fn cached_node_modules(&self, cache: &Cache) -> Option { + pub fn cached_node_modules( + &self, + cache: &Cache, + ) -> Option { self.node_modules.get_or_init(|| self.module_directory("node_modules", cache)).clone() } diff --git a/crates/oxc_resolver/src/file_system.rs b/crates/oxc_resolver/src/file_system.rs index 5362b62fb..62a249a07 100644 --- a/crates/oxc_resolver/src/file_system.rs +++ b/crates/oxc_resolver/src/file_system.rs @@ -4,7 +4,7 @@ use std::{ }; /// File System abstraction used for `ResolverGeneric`. -pub trait FileSystem: Default + Send + Sync { +pub trait FileSystem: Send + Sync { /// See [std::fs::read_to_string] /// /// # Errors diff --git a/crates/oxc_resolver/src/lib.rs b/crates/oxc_resolver/src/lib.rs index d619dc9a4..16b7030e2 100644 --- a/crates/oxc_resolver/src/lib.rs +++ b/crates/oxc_resolver/src/lib.rs @@ -134,13 +134,13 @@ struct ResolveContextImpl { depth: u8, } -impl Default for ResolverGeneric { +impl Default for ResolverGeneric { fn default() -> Self { Self::new(ResolveOptions::default()) } } -impl ResolverGeneric { +impl ResolverGeneric { pub fn new(options: ResolveOptions) -> Self { #[cfg(feature = "tracing-subscriber")] tracing_subscriber::init();