Skip to content

Commit

Permalink
Fix turbopack-core
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed May 28, 2024
1 parent c99e4c1 commit 98b8911
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crates/turbopack-core/src/resolve/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl AliasTemplate for Vc<ImportMapping> {
.await?,
),
ImportMapping::Dynamic(replacement) => {
(*replacement.replace(capture.to_string()).await?).clone()
(*replacement.replace(capture.into()).await?).clone()
}
}
.cell())
Expand Down Expand Up @@ -523,7 +523,7 @@ pub async fn resolve_modules_options(

#[turbo_tasks::value_trait]
pub trait ImportMappingReplacement {
fn replace(self: Vc<Self>, capture: String) -> Vc<ImportMapping>;
fn replace(self: Vc<Self>, capture: RcStr) -> Vc<ImportMapping>;
fn result(
self: Vc<Self>,
lookup_path: Vc<FileSystemPath>,
Expand Down
4 changes: 2 additions & 2 deletions crates/turbopack-core/src/resolve/origin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub trait ResolveOriginExt: Send {
fn resolve_options(self: Vc<Self>, reference_type: Value<ReferenceType>) -> Vc<ResolveOptions>;

/// Adds a transition that is used for resolved assets.
fn with_transition(self: Vc<Self>, transition: String) -> Vc<Box<dyn ResolveOrigin>>;
fn with_transition(self: Vc<Self>, transition: RcStr) -> Vc<Box<dyn ResolveOrigin>>;
}

impl<T> ResolveOriginExt for T
Expand All @@ -65,7 +65,7 @@ where
.resolve_options(self.origin_path(), reference_type)
}

fn with_transition(self: Vc<Self>, transition: String) -> Vc<Box<dyn ResolveOrigin>> {
fn with_transition(self: Vc<Self>, transition: RcStr) -> Vc<Box<dyn ResolveOrigin>> {
Vc::upcast(
ResolveOriginWithTransition {
previous: Vc::upcast(self),
Expand Down
2 changes: 1 addition & 1 deletion crates/turbopack-core/src/resolve/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl Request {
Request::PackageInternal {
path: Pattern::Constant(r),
}
} else if r.starts_with("./") || r.starts_with("../") || r == "." || r == ".." {
} else if r.starts_with("./") || r.starts_with("../") || &*r == "." || &*r == ".." {
let (path, query, fragment) = split_off_query_fragment(r);

Request::Relative {
Expand Down

0 comments on commit 98b8911

Please sign in to comment.