Skip to content

Commit

Permalink
refactor(turbopack): Simplify EcmascriptModulePartAsset::ident (#71337
Browse files Browse the repository at this point in the history
)

### What?

Simplify `ident` implementation of `EcmascriptModulePartAsset`.

### Why?

`EcmascriptModulePartAsset` is not created if a module is not splitted.

### How?
  • Loading branch information
kdy1 authored Oct 17, 2024
1 parent ac9ee5d commit 1dd4695
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,8 @@ impl EcmascriptModulePartAsset {
#[turbo_tasks::value_impl]
impl Module for EcmascriptModulePartAsset {
#[turbo_tasks::function]
async fn ident(&self) -> Result<Vc<AssetIdent>> {
let inner = self.full_module.ident();
let result = split_module(self.full_module);

match &*result.await? {
SplitResult::Ok { .. } => Ok(inner.with_part(self.part)),
SplitResult::Failed { .. } => Ok(inner),
}
fn ident(&self) -> Vc<AssetIdent> {
self.full_module.ident().with_part(self.part)
}

#[turbo_tasks::function]
Expand Down

0 comments on commit 1dd4695

Please sign in to comment.