google / google/pdl

Feature request: infallible "from" for custom fields with bits that are a multiple of 8

Open
#75 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
86
Forks
18
Avg merge
20h 49m
Merged PRs (30d)
1

Description

If a custom field takes up, say, 48 bits, and each bit can be arbitrarily anything, then it should be able to infallibly be converted from a [u8; 6].

But the current generated code performs a fallible try_from(u64), which would require wrangling a series of bytes into a [u8; 8], and then converted to a u64.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.