Skip to content

Conversation

crepererum
Copy link
Collaborator

Actually we don't need this, all our nested types fall roughly into three categories:

  • no perf critical: Use Box::pin to create a new allocation Pin<Box<T>>
  • already alloated: They where already wrapped in a Box<T> (e.g. for enums with vastly different variants), so Pin<Box<T>> is the same overhead.
  • Unpin: Some upstream types implement Unpin, so you can just use Pin::new(&mut x).

Actually we don't need this, all our nested types fall roughly into
three categories:

- **no perf critical:** Use `Box::pin` to create a new allocation
  `Pin<Box<T>>`
- **already alloated:** They where already wrapped in a `Box<T>` (e.g.
  for enums with vastly different variants), so `Pin<Box<T>>` is the
  same overhead.
- **`Unpin`:** Some upstream types implement `Unpin`, so you can just
  use `Pin::new(&mut x)`.
@crepererum crepererum force-pushed the crepererum/drop_pin_project_lite branch from b69911f to e8c97af Compare August 6, 2024 10:37
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like easier to follow code and fewer dependencies. 👍 thank you @crepererum

@alamb alamb merged commit a331d09 into main Aug 6, 2024
@alamb alamb deleted the crepererum/drop_pin_project_lite branch August 6, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants