Skip to content

Commit b65ab99

Browse files
committed
simplify the diff a bit
1 parent 8216dbe commit b65ab99

File tree

3 files changed

+11
-23
lines changed

3 files changed

+11
-23
lines changed

crates/next-core/src/next_image/module.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ impl StructuredImageModuleType {
5858
let static_asset = StaticUrlJsModule::new(*source).to_resolved().await?;
5959
Ok(module_asset_context
6060
.process(
61-
Vc::upcast(StructuredImageFileSource::new(
62-
*source,
63-
blur_placeholder_mode,
64-
)),
61+
Vc::upcast(
62+
StructuredImageFileSource {
63+
image: source,
64+
blur_placeholder_mode,
65+
}
66+
.cell(),
67+
),
6568
ReferenceType::Internal(ResolvedVc::cell(fxindexmap!(
6669
rcstr!("IMAGE") => ResolvedVc::upcast(static_asset)
6770
))),

crates/next-core/src/next_image/source_asset.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,10 @@ fn blur_options() -> Vc<BlurPlaceholderOptions> {
2525

2626
/// An source asset that transforms an image into javascript code which exports
2727
/// an object with meta information like width, height and a blur placeholder.
28-
#[turbo_tasks::value]
28+
#[turbo_tasks::value(shared)]
2929
pub struct StructuredImageFileSource {
30-
image: ResolvedVc<Box<dyn Source>>,
31-
blur_placeholder_mode: BlurPlaceholderMode,
32-
}
33-
34-
#[turbo_tasks::value_impl]
35-
impl StructuredImageFileSource {
36-
#[turbo_tasks::function]
37-
pub fn new(
38-
image: ResolvedVc<Box<dyn Source>>,
39-
blur_placeholder_mode: BlurPlaceholderMode,
40-
) -> Vc<Self> {
41-
Self {
42-
image,
43-
blur_placeholder_mode,
44-
}
45-
.cell()
46-
}
30+
pub image: ResolvedVc<Box<dyn Source>>,
31+
pub blur_placeholder_mode: BlurPlaceholderMode,
4732
}
4833

4934
#[turbo_tasks::value_impl]

turbopack/crates/turbo-tasks/src/trait_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{fmt::Debug, future::Future, marker::PhantomData, ptr::DynMetadata};
1+
use std::{fmt::Debug, future::Future, marker::PhantomData};
22

33
use anyhow::Result;
44
use serde::{Deserialize, Serialize};

0 commit comments

Comments
 (0)