From 9ada817af43f5a6b0fe3eb1671597d531486621a Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Mon, 7 Oct 2024 19:36:27 +1100 Subject: [PATCH] chore: cargo fmt --- src/project.rs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/project.rs b/src/project.rs index 44f6441..726e2fd 100644 --- a/src/project.rs +++ b/src/project.rs @@ -1,8 +1,8 @@ use anyhow::anyhow; use anyhow::Result; +use deno_ast::dep::analyze_module_dependencies; use deno_ast::dep::DependencyDescriptor; use deno_ast::parse_module; -use deno_ast::dep::analyze_module_dependencies; use deno_ast::MediaType; use deno_ast::ParseParams; use futures::future::Future; @@ -167,13 +167,15 @@ impl Project { for dep in deps { match dep { DependencyDescriptor::Static(descriptor) => { - if let Ok(specifier) = self.resolve(descriptor.specifier.to_string(), &specifier) { + if let Ok(specifier) = + self.resolve(descriptor.specifier.to_string(), &specifier) + { if !self.specifiers.contains(&specifier) { self.load(&specifier)?; self.specifiers.insert(specifier); } } - }, + } _ => {} } } @@ -201,22 +203,21 @@ mod tests { #[test] fn test_parse_module() { let file = parse_module(ParseParams { - specifier: Url::from_file_path("/home/kitsonk/github/tests/fixtures/a.ts").unwrap(), - text: - r#" + specifier: Url::from_file_path( + "/home/kitsonk/github/tests/fixtures/a.ts", + ) + .unwrap(), + text: r#" const a = require("fs"); "# - .into(), + .into(), media_type: MediaType::TypeScript, capture_tokens: true, scope_analysis: false, maybe_syntax: None, }) .unwrap(); - let deps = analyze_module_dependencies( - file.module(), - file.comments(), - ); + let deps = analyze_module_dependencies(file.module(), file.comments()); println!("{:?}", deps); } }