From 0d474165d74f32ed61f0c875958b61ed3a5fc3df Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:24:01 +0000 Subject: [PATCH 1/2] chore(deps): update dependency rust to v1.81.0 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7f466bd2..bbf217f2 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.80.1" +channel = "1.81.0" profile = "default" From ce2eb635d7e3f663c92cad9abcae4d47e1fc809e Mon Sep 17 00:00:00 2001 From: Boshen Date: Fri, 6 Sep 2024 08:36:05 +0800 Subject: [PATCH 2/2] fix --- src/lib.rs | 5 +++-- src/tsconfig.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e9e9e7ff..e6cb2246 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1288,8 +1288,9 @@ impl ResolverGeneric { let mut has_dot = false; let mut without_dot = false; for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); + let starts_with_dot_or_hash = key.starts_with(['.', '#']); + has_dot = has_dot || starts_with_dot_or_hash; + without_dot = without_dot || !starts_with_dot_or_hash; if has_dot && without_dot { return Err(ResolveError::InvalidPackageConfig( package_url.join("package.json"), diff --git a/src/tsconfig.rs b/src/tsconfig.rs index 0de8e8ec..6a675442 100644 --- a/src/tsconfig.rs +++ b/src/tsconfig.rs @@ -146,7 +146,7 @@ impl TsConfig { // Copied from parcel // pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { + if specifier.starts_with(['/', '.']) { return vec![]; }