Skip to content

bytes: Use a const {} block for this assertion #281

@github-actions

Description

@github-actions

On 2023-07-29 @prestwich wrote in aaa37d2 “Merge pull request #277 from DaniPopes/no_alloc”:

Use a const {} block for this assertion

    /// Rust issue [#60551].
    ///
    /// [#60551]: https://github.com/rust-lang/rust/issues/60551
    #[must_use]
    pub fn to_le_bytes<const BYTES: usize>(&self) -> [u8; BYTES] {
        // TODO: Use a `const {}` block for this assertion
        assert_eq!(BYTES, Self::BYTES, "BYTES must be equal to Self::BYTES");

        let mut bytes = [0; BYTES];

        #[cfg(target_endian = "little")]

From src/bytes.rs:94

Metadata

Metadata

Assignees

Labels

to doTo be donetrackerIssue tracked by bot

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions