Skip to content

Commit

Permalink
Manual cleanup of LLM-generated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bgw committed Oct 25, 2024
1 parent ec891e4 commit 2dcfb56
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 113 deletions.
10 changes: 5 additions & 5 deletions turbopack/crates/node-file-trace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use serde::Deserialize;
use serde::Serialize;
use tokio::sync::mpsc::channel;
use turbo_tasks::{
backend::Backend, util::FormatDuration, RcStr, ReadConsistency, TaskId, TransientInstance,
TransientValue, TurboTasks, UpdateInfo, Value, Vc,
backend::Backend, util::FormatDuration, RcStr, ReadConsistency, ResolvedVc, TaskId,
TransientInstance, TransientValue, TurboTasks, UpdateInfo, Value, Vc,
};
use turbo_tasks_fs::{
glob::Glob, DirectoryEntry, DiskFileSystem, FileSystem, FileSystemPath, ReadGlobResult,
Expand Down Expand Up @@ -565,7 +565,7 @@ async fn main_operation(

#[turbo_tasks::function]
async fn create_module_asset(
root: Vc<FileSystemPath>,
root: ResolvedVc<FileSystemPath>,
process_cwd: Option<RcStr>,
module_options: TransientInstance<ModuleOptionsContext>,
resolve_options: TransientInstance<ResolveOptionsContext>,
Expand All @@ -580,14 +580,14 @@ async fn create_module_asset(
let compile_time_info = CompileTimeInfo::builder(env).cell();
let glob_mappings = vec![
(
root.to_resolved().await?,
root,
Glob::new("**/*/next/dist/server/next.js".into())
.to_resolved()
.await?,
ImportMapping::Ignore.resolved_cell(),
),
(
root.to_resolved().await?,
root,
Glob::new("**/*/next/dist/bin/next".into())
.to_resolved()
.await?,
Expand Down
2 changes: 1 addition & 1 deletion turbopack/crates/turbopack-cli/src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl TurbopackBuildBuilder {
self.entry_requests
.iter()
.cloned()
.map(EntryRequest::resolved_cell) // Changed from cell() to resolved_cell()
.map(EntryRequest::resolved_cell)
.collect(),
)
.cell(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,13 @@ impl AvailableChunkItems {
#[turbo_tasks::function]
pub async fn get(
&self,
chunk_item: Vc<Box<dyn ChunkItem>>,
chunk_item: ResolvedVc<Box<dyn ChunkItem>>,
) -> Result<Vc<OptionAvailableChunkItemInfo>> {
let resolved_chunk_item = chunk_item.to_resolved().await?;
if let Some(&info) = self.chunk_items.await?.get(&resolved_chunk_item) {
if let Some(&info) = self.chunk_items.await?.get(&chunk_item) {
return Ok(Vc::cell(Some(info)));
};
if let Some(parent) = self.parent {
return Ok(parent.get(chunk_item));
return Ok(parent.get(*chunk_item));
}
Ok(Vc::cell(None))
}
Expand Down
1 change: 0 additions & 1 deletion turbopack/crates/turbopack-core/src/chunk/chunk_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ pub async fn make_chunk_group(
chunks.extend(async_loader_chunks.iter().copied());
}

// Convert chunks to ResolvedVc
let resolved_chunks = chunks
.into_iter()
.map(|chunk| chunk.to_resolved())
Expand Down
16 changes: 6 additions & 10 deletions turbopack/crates/turbopack-core/src/chunk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,7 @@ async fn chunk_content_internal_parallel(
Ok(Some(ChunkGraphEdge {
key: Some(entry.to_resolved().await?),
node: ChunkContentGraphNode::ChunkItem {
item: *chunkable_module
.as_chunk_item(chunking_context)
.to_resolved()
.await?,
item: chunkable_module.as_chunk_item(chunking_context),
ident: chunkable_module.ident().to_string().await?,
},
}))
Expand Down Expand Up @@ -743,12 +740,11 @@ pub struct AsyncModuleInfo {
impl AsyncModuleInfo {
#[turbo_tasks::function]
pub async fn new(referenced_async_modules: Vec<Vc<Box<dyn ChunkItem>>>) -> Result<Vc<Self>> {
let resolved_modules = futures::future::try_join_all(
referenced_async_modules
.into_iter()
.map(|m| m.to_resolved()),
)
.await?;
let resolved_modules = referenced_async_modules
.into_iter()
.map(|m| m.to_resolved())
.try_join()
.await?;

Ok(Self {
referenced_async_modules: resolved_modules.into_iter().collect(),
Expand Down
17 changes: 8 additions & 9 deletions turbopack/crates/turbopack-core/src/introspect/output_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ pub struct IntrospectableOutputAsset(ResolvedVc<Box<dyn OutputAsset>>);
#[turbo_tasks::value_impl]
impl IntrospectableOutputAsset {
#[turbo_tasks::function]
pub async fn new(asset: Vc<Box<dyn OutputAsset>>) -> Result<Vc<Box<dyn Introspectable>>> {
let resolved_asset = asset.to_resolved().await?;
Ok(
*ResolvedVc::try_sidecast::<Box<dyn Introspectable>>(resolved_asset)
.await?
.unwrap_or_else(|| {
ResolvedVc::upcast(IntrospectableOutputAsset(resolved_asset).resolved_cell())
}),
)
pub async fn new(
asset: ResolvedVc<Box<dyn OutputAsset>>,
) -> Result<Vc<Box<dyn Introspectable>>> {
Ok(*ResolvedVc::try_sidecast::<Box<dyn Introspectable>>(asset)
.await?
.unwrap_or_else(|| {
ResolvedVc::upcast(IntrospectableOutputAsset(asset).resolved_cell())
}))
}
}

Expand Down
Loading

0 comments on commit 2dcfb56

Please sign in to comment.