Skip to content

add nonmax_xx!(..) macros with compile time checking#21

Open
rinde wants to merge 1 commit intoLPGhatguy:mainfrom
rinde:add-constructor-macros
Open

add nonmax_xx!(..) macros with compile time checking#21
rinde wants to merge 1 commit intoLPGhatguy:mainfrom
rinde:add-constructor-macros

Conversation

@rinde
Copy link
Copy Markdown

@rinde rinde commented May 27, 2025

Adds a macro for each of the integer types to allow construction of the NonMaxXX type using compile time checking.

Example

let _ = nonmax_u8!(254); // works
let _ = nonmax_u8!(255); // compile error

This increases the MSRV to 1.60.

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