Skip to content

Commit

Permalink
feat(codegen): support NonZero numbers (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
clearloop authored Jun 12, 2023
1 parent 00f10be commit a62d6a4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions codegen/src/types/type_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ impl TypePathType {
"BTreeSet" => parse_quote!(::std::collections::BTreeSet),
"Range" => parse_quote!(::core::ops::Range),
"RangeInclusive" => parse_quote!(::core::ops::RangeInclusive),
"NonZeroI8" => parse_quote!(::core::num::NonZeroI8),
"NonZeroU8" => parse_quote!(::core::num::NonZeroU8),
"NonZeroI16" => parse_quote!(::core::num::NonZeroI16),
"NonZeroU16" => parse_quote!(::core::num::NonZeroU16),
"NonZeroI32" => parse_quote!(::core::num::NonZeroI32),
"NonZeroU32" => parse_quote!(::core::num::NonZeroU32),
"NonZeroI64" => parse_quote!(::core::num::NonZeroI64),
"NonZeroU64" => parse_quote!(::core::num::NonZeroU64),
"NonZeroI128" => parse_quote!(::core::num::NonZeroI128),
"NonZeroU128" => parse_quote!(::core::num::NonZeroU128),
"NonZeroIsize" => parse_quote!(::core::num::NonZeroIsize),
"NonZeroUsize" => parse_quote!(::core::num::NonZeroUsize),
ident => panic!("Unknown prelude type '{ident}'"),
}
}
Expand Down

0 comments on commit a62d6a4

Please sign in to comment.