Skip to content

Commit

Permalink
chore(turbopack-browser): Pedantically fix minor typos in comments ab…
Browse files Browse the repository at this point in the history
…out TraitRef (#73772)

I was looking for callsites of `TraitRef` and found these minor typos, which annoyed me a bit, so I'm fixing them:

- It's `TraitRef<Box<dyn Foo>>`, not `TraitRef<Vc<Box<dyn Foo>>>`.
- This is a reference to an associated function, so it should use a turbofish.
- Re-wrap with the newer fixed 120 column line wrap for columns.
  • Loading branch information
bgw authored Dec 13, 2024
1 parent 4ba5843 commit c4b2df2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@ pub(super) async fn update_chunk_list(
let to = to_version.await?;
let from = from_version.await?;

// When to and from point to the same value we can skip comparing them.
// This will happen since `TraitRef<Vc<Box<dyn Version>>>::cell` will not clone
// the value, but only make the cell point to the same immutable value
// (Arc).
// When to and from point to the same value we can skip comparing them. This will happen since
// `TraitRef::<Box<dyn Version>>::cell` will not clone the value, but only make the cell point
// to the same immutable value (`Arc`).
if from.ptr_eq(&to) {
return Ok(Update::None.cell());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,9 @@ pub(super) async fn update_ecmascript_merged_chunk(
let to = to_merged_version.await?;
let from = from_merged_version.await?;

// When to and from point to the same value we can skip comparing them.
// This will happen since `TraitRef<Vc<Box<dyn Version>>>::cell` will not clone
// the value, but only make the cell point to the same immutable value
// (Arc).
// When to and from point to the same value we can skip comparing them. This will happen since
// `TraitRef::<Box<dyn Version>>::cell` will not clone the value, but only make the cell point
// to the same immutable value (`Arc`).
if from.ptr_eq(&to) {
return Ok(Update::None);
}
Expand Down
7 changes: 3 additions & 4 deletions turbopack/crates/turbopack-browser/src/ecmascript/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ pub(super) async fn update_ecmascript_chunk(
) -> Result<EcmascriptChunkUpdate> {
let to = content.own_version().await?;

// When to and from point to the same value we can skip comparing them.
// This will happen since `TraitRef<Vc<Box<dyn Version>>>::cell` will not clone
// the value, but only make the cell point to the same immutable value
// (Arc).
// When to and from point to the same value we can skip comparing them. This will happen since
// `TraitRef::<Box<dyn Version>>::cell` will not clone the value, but only make the cell point
// to the same immutable value (`Arc`).
if from.ptr_eq(&to) {
return Ok(EcmascriptChunkUpdate::None);
}
Expand Down

0 comments on commit c4b2df2

Please sign in to comment.