Skip to content

Commit 2577f82

Browse files
committed
reduce diff
1 parent 09c227c commit 2577f82

File tree

1 file changed

+5
-6
lines changed
  • turbopack/crates/turbopack-core/src/resolve

1 file changed

+5
-6
lines changed

turbopack/crates/turbopack-core/src/resolve/mod.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,20 +2268,19 @@ async fn resolve_relative_request(
22682268
let mut pushed = false;
22692269
if !added_extension_alternatives.is_empty() {
22702270
for ext in added_extension_alternatives.iter() {
2271-
let Some(extensionless_matched_pattern) = matched_pattern.strip_suffix(&**ext)
2272-
else {
2271+
let Some(matched_pattern) = matched_pattern.strip_suffix(&**ext) else {
22732272
continue;
22742273
};
22752274

2276-
if !seen_base_patterns.insert(extensionless_matched_pattern) {
2275+
if !seen_base_patterns.insert(matched_pattern) {
22772276
continue 'matches; // Skip this entire file
22782277
}
22792278

22802279
if !fragment.is_empty() {
22812280
// If the fragment is not empty, we need to strip it from the matched
22822281
// pattern
22832282
if let Some(extensionless_matched_pattern) =
2284-
extensionless_matched_pattern.strip_suffix(fragment.as_str())
2283+
matched_pattern.strip_suffix(fragment.as_str())
22852284
{
22862285
results.push(
22872286
resolved(
@@ -2299,10 +2298,10 @@ async fn resolve_relative_request(
22992298
pushed = true;
23002299
}
23012300
}
2302-
if !pushed && path_pattern.is_match(extensionless_matched_pattern) {
2301+
if !pushed && path_pattern.is_match(matched_pattern) {
23032302
results.push(
23042303
resolved(
2305-
RequestKey::new(extensionless_matched_pattern.into()),
2304+
RequestKey::new(matched_pattern.into()),
23062305
path.clone(),
23072306
lookup_path.clone(),
23082307
request,

0 commit comments

Comments
 (0)