Skip to content

Commit 13af7b5

Browse files
authored
Turbopack: remove dead code (#79280)
- `IncludeIdentModule` is unused (and incompatible with the ModuleGraph anyway) - Cleanup some `todo!()`s
1 parent 1bc1326 commit 13af7b5

File tree

5 files changed

+6
-37
lines changed

5 files changed

+6
-37
lines changed

turbopack/crates/turbopack-dev-server/src/source/static_assets.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ impl Introspectable for StaticAssetsContentSource {
140140
.to_resolved()
141141
.await?,
142142
),
143-
DirectoryEntry::Other(_) => todo!("what's DirectoryContent::Other?"),
144-
DirectoryEntry::Error => todo!(),
143+
DirectoryEntry::Other(_) | DirectoryEntry::Error => {
144+
todo!("unsupported DirectoryContent variant: {entry:?}")
145+
}
145146
};
146147
Ok((ResolvedVc::cell(name.clone()), child))
147148
}

turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl Module for AsyncLoaderModule {
7676
impl Asset for AsyncLoaderModule {
7777
#[turbo_tasks::function]
7878
fn content(&self) -> Vc<AssetContent> {
79-
todo!()
79+
panic!("content() should not be called");
8080
}
8181
}
8282

turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl Module for ManifestAsyncModule {
152152
impl Asset for ManifestAsyncModule {
153153
#[turbo_tasks::function]
154154
fn content(&self) -> Vc<AssetContent> {
155-
todo!()
155+
panic!("content() should not be called");
156156
}
157157
}
158158

turbopack/crates/turbopack-ecmascript/src/references/external_module.rs

-32
Original file line numberDiff line numberDiff line change
@@ -268,35 +268,3 @@ impl EcmascriptChunkItem for CachedExternalModuleChunkItem {
268268
)
269269
}
270270
}
271-
272-
/// A module that only has an ident and no content nor references.
273-
///
274-
/// It is used to include a module's ident in the module graph before the module
275-
/// itself is resolved, as is the case with NextServerComponentModule's
276-
/// "client modules" and "ssr modules".
277-
#[turbo_tasks::value]
278-
pub struct IncludeIdentModule {
279-
ident: ResolvedVc<AssetIdent>,
280-
}
281-
282-
#[turbo_tasks::value_impl]
283-
impl IncludeIdentModule {
284-
#[turbo_tasks::function]
285-
pub fn new(ident: ResolvedVc<AssetIdent>) -> Vc<Self> {
286-
Self { ident }.cell()
287-
}
288-
}
289-
290-
impl Asset for IncludeIdentModule {
291-
fn content(self: Vc<Self>) -> Vc<AssetContent> {
292-
todo!("IncludeIdentModule doesn't implement content()")
293-
}
294-
}
295-
296-
#[turbo_tasks::value_impl]
297-
impl Module for IncludeIdentModule {
298-
#[turbo_tasks::function]
299-
fn ident(&self) -> Vc<AssetIdent> {
300-
*self.ident
301-
}
302-
}

turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl Module for WorkerLoaderModule {
6262
impl Asset for WorkerLoaderModule {
6363
#[turbo_tasks::function]
6464
fn content(&self) -> Vc<AssetContent> {
65-
todo!()
65+
panic!("content() should not be called");
6666
}
6767
}
6868

0 commit comments

Comments
 (0)