Skip to content

Commit

Permalink
Delete dead concatenate_output_assets function (#65337)
Browse files Browse the repository at this point in the history
I noticed this was dead while working on other changes to this file.

Checked that it built with:

```
cargo check
```
  • Loading branch information
bgw authored May 3, 2024
1 parent e8acd2d commit 8dc0eff
Showing 1 changed file with 2 additions and 32 deletions.
34 changes: 2 additions & 32 deletions packages/next-swc/crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ use next_core::{
};
use serde::{Deserialize, Serialize};
use tracing::Instrument;
use turbo_tasks::{trace::TraceRawVcs, Completion, TryFlatJoinIterExt, TryJoinIterExt, Value, Vc};
use turbo_tasks::{trace::TraceRawVcs, Completion, TryJoinIterExt, Value, Vc};
use turbopack_binding::{
turbo::{
tasks_env::{CustomProcessEnv, ProcessEnv},
tasks_fs::{rope::RopeBuilder, File, FileContent, FileSystemPath},
tasks_fs::{File, FileContent, FileSystemPath},
},
turbopack::{
core::{
Expand Down Expand Up @@ -1244,36 +1244,6 @@ impl AppEndpoint {
}
}

#[turbo_tasks::function]
async fn concatenate_output_assets(
path: Vc<FileSystemPath>,
files: Vc<OutputAssets>,
) -> Result<Vc<Box<dyn OutputAsset>>> {
let mut concatenated_content = RopeBuilder::default();
let contents = files
.await?
.iter()
.map(|&file| async move {
Ok(
if let AssetContent::File(content) = *file.content().await? {
Some(content.await?)
} else {
None
},
)
})
.try_flat_join()
.await?;
for file in contents.iter().flat_map(|content| content.as_content()) {
concatenated_content.concat(file.content());
concatenated_content.push_static_bytes(b"\n\n");
}
Ok(Vc::upcast(VirtualOutputAsset::new(
path,
AssetContent::file(FileContent::Content(concatenated_content.build().into()).cell()),
)))
}

#[turbo_tasks::value_impl]
impl Endpoint for AppEndpoint {
#[turbo_tasks::function]
Expand Down

0 comments on commit 8dc0eff

Please sign in to comment.