Skip to content

List from_be_bytes as Alternative in Transmute Docs #71187

Closed
@domenukk

Description

@domenukk

Many code bases I see use transmute to convert raw bytes (&[u8]) to u32, f64, etc. - while they could, and probably should, use from_le_bytes or from_be_bytes.
The transmute docs include a lengthy section about Alternatives, but this obvious one seems to be missing.

Metadata

Metadata

Assignees

Labels

C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions