oxidecomputer / oxidecomputer/typify
integer in the range [1..32] is represented as a `NonZeroU64`
Open
@ahl is already working on this.
Since Feb 14, 2026.
- Dominant language
- Rust
- Stars
- 898
- Forks
- 114
- Avg merge
- 4h 18m
- Merged PRs (30d)
- 14
Description
{
"$defs": {
"MaxPathConfig": {
"type": "integer",
"maximum": 32,
"minimum": 1
}
}
}
Turns into
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct MaxPathConfig(pub ::std::num::NonZeroU64);
impl ::std::ops::Deref for MaxPathConfig {
type Target = ::std::num::NonZeroU64;
fn deref(&self) -> &::std::num::NonZeroU64 {
&self.0
}
}
That's fine but I'd prefer to see something like this:
pub struct MaxPathConfig(u8)
impl TryFrom<u8> for MaxPathConfig {
// ...
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.