Skip to content

Commit

Permalink
Merge pull request #85 from artichoke/lopopolo/from_vec_spruce
Browse files Browse the repository at this point in the history
Code quality improvements on `RawParts::from_vec`
  • Loading branch information
lopopolo authored May 31, 2023
2 parents c81b046 + 7274ae5 commit 4026b6c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,10 @@ impl<T> RawParts<T> {
/// assert_eq!(rebuilt, [4294967295, 0, 1]);
/// ```
#[must_use]
pub fn from_vec(vec: Vec<T>) -> RawParts<T> {
// TODO: convert to `Vec::into_raw_parts` once it is stabilized.
// See: https://doc.rust-lang.org/1.56.0/src/alloc/vec/mod.rs.html#717-720
pub fn from_vec(vec: Vec<T>) -> Self {
// FIXME Update this when vec_into_raw_parts is stabilized
// See: https://doc.rust-lang.org/1.69.0/src/alloc/vec/mod.rs.html#823-826
// See: https://doc.rust-lang.org/beta/unstable-book/library-features/vec-into-raw-parts.html
//
// https://github.com/rust-lang/rust/issues/65816
let mut me = ManuallyDrop::new(vec);
Expand Down

0 comments on commit 4026b6c

Please sign in to comment.