Skip to content

Conversation

@krakow10
Copy link
Contributor

@krakow10 krakow10 commented Dec 7, 2025

Adds a new type SomeRef(NonZeroU128) as described in #581. The new type signature of Ref reads as follows: OptionalRef(Option<SomeRef>). The names are open to debate. Many Ref values passed as function arguments should never be allowed to be null, but this is not reflected by the data model. This series implements the new type in 3 stages:

  1. Introduce just the new type and its bells and whistles, no code is broken.
  2. Implement the new type internally within the library with minimal public interface changes.
  3. Implement the new type where applicable in public interfaces.

Some tests are modified to use the public interface of the things being tested, because in part 2 the public interface is not supposed to change, but the internals do change.

Notes:

  • Content is given a new function from_some_ref, but does not use the new type internally. That change is in part 2.
  • Ref is renamed to OptionalRef to more accurately describe it, and a type alias for Ref is created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant