Skip to content

Commit e07d8b3

Browse files
committed
Use underlying walkdir::WalkDir instead of ignore::Walk
1 parent 55aa82e commit e07d8b3

5 files changed

Lines changed: 8 additions & 7 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ typst = "0.14.2"
3434
typst-assets = { version = "0.14.2", features = [ "fonts" ] }
3535
typst-eval = "0.14.2"
3636
url = "2.5.7"
37+
walkdir = "2.5.0"
3738
wasm-opt = "0.116.1"

src/check/files.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::collections::HashSet;
22
use std::path::Path;
33

44
use codespan_reporting::diagnostic::{Diagnostic, Label};
5+
use walkdir::WalkDir;
56

67
use crate::check::manifest::Manifest;
78
use crate::check::path::PackagePath;
@@ -22,8 +23,7 @@ pub fn check(
2223
// excluded files.
2324
let mut excluded_dirs = HashSet::new();
2425

25-
for ch in ignore::WalkBuilder::new(package_dir).hidden(false).build() {
26-
let Ok(ch) = ch else { continue };
26+
for ch in WalkDir::new(package_dir).into_iter().flatten() {
2727
let Ok(metadata) = ch.metadata() else {
2828
continue;
2929
};

src/check/imports.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use typst::{
1111
},
1212
World,
1313
};
14+
use walkdir::WalkDir;
1415

1516
use crate::check::path::PackagePath;
1617
use crate::check::{label, Diagnostics, Result, TryExt};
@@ -27,10 +28,7 @@ pub fn check(diags: &mut Diagnostics, package_dir: &Path, world: &SystemWorld) -
2728
.and_then(|package_dir| package_dir.parent())
2829
.and_then(|namespace_dir| namespace_dir.parent());
2930

30-
for ch in ignore::Walk::new(package_dir) {
31-
let Ok(ch) = ch else {
32-
continue;
33-
};
31+
for ch in WalkDir::new(package_dir).into_iter().flatten() {
3432
let Ok(meta) = ch.metadata() else {
3533
continue;
3634
};

src/check/manifest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use typst::syntax::{
1010
package::{PackageSpec, PackageVersion},
1111
FileId, VirtualPath,
1212
};
13+
use walkdir::WalkDir;
1314

1415
use crate::check::path::{self, PackagePath};
1516
use crate::{
@@ -613,7 +614,7 @@ fn dont_exclude_template_files(
613614
return;
614615
};
615616

616-
for entry in ignore::Walk::new(template_path.full()).flatten() {
617+
for entry in WalkDir::new(template_path.full()).into_iter().flatten() {
617618
let entry_path = PackagePath::from_full(package_dir, entry.path());
618619

619620
// For build artifacts, ask the package author to delete them.

0 commit comments

Comments
 (0)