Skip to content

Commit

Permalink
chore: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk committed Oct 7, 2024
1 parent e9f0995 commit 9ada817
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/project.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
}
}
},
}
_ => {}
}
}
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 9ada817

Please sign in to comment.