oxidecomputer / oxidecomputer/typify

integer in the range [1..32] is represented as a `NonZeroU64`

Open
#975 2 comments 0 reactions 1 assignee View on GitHub

@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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.