Skip to content

provekit/common/src/utils/mod: Cleanup when <https://github.com/rust-lang/rust/issues/96097> lands #161

@recmo

Description

@recmo

On 2025-08-29 in 2a57572 “Merge pull request #153 from worldfnd/px/refactor”:

Cleanup when rust-lang/rust#96097 lands
Required for MaybeUninit

    const CACHE_SIZE: usize = 1 << 15;
    CACHE_SIZE / size_of::<T>()
}

/// Unzip a [[(T,T); N]; M] into ([[T; N]; M],[[T; N]; M]) using move semantics
// TODO: Cleanup when <https://github.com/rust-lang/rust/issues/96097> lands
#[allow(unsafe_code)] // Required for `MaybeUninit`
fn unzip_double_array<T: Sized, const N: usize, const M: usize>(
    input: [[(T, T); N]; M],
) -> ([[T; N]; M], [[T; N]; M]) {
    // Create uninitialized memory for the output arrays
    let mut left: [[MaybeUninit<T>; N]; M] = [const { [const { MaybeUninit::uninit() }; N] }; M];

From provekit/common/src/utils/mod.rs:36

Metadata

Metadata

Assignees

No one assigned

    Labels

    to doTo do comments in codetracker🤖 issue managed by tracker bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions