#primitives #u128 #i128

extprim_literals

Plugin for creating extra primitive types literals (u128!(n), i128!(n))

10 releases (stable)

Uses old Rust 2015

2.0.3 Jul 11, 2017
2.0.2 Jun 16, 2017
2.0.0 Mar 18, 2017
1.2.0 Jan 12, 2017
0.2.2 Jan 10, 2015

#12 in #primitives

Download history 90/week @ 2022-11-26 95/week @ 2022-12-03 105/week @ 2022-12-10 122/week @ 2022-12-17 105/week @ 2022-12-24 77/week @ 2022-12-31 91/week @ 2023-01-07 86/week @ 2023-01-14 106/week @ 2023-01-21 107/week @ 2023-01-28 145/week @ 2023-02-04 123/week @ 2023-02-11 128/week @ 2023-02-18 97/week @ 2023-02-25 100/week @ 2023-03-04 61/week @ 2023-03-11

401 downloads per month
Used in 2 crates

MIT/Apache

195KB
3.5K SLoC

Literal macros for extprim.

This crate provides a syntex extension (on stable) so that the extprim types can be constructed at compile-time using the i128!() and u128!() macros.

Setup

Simply add extprim_literals to dependencies in Cargo.toml:

[dependencies]
extprim_literals = "2.0"

Use the macros in src/consts.rs:

#[macro_use] extern crate extprim_literals;
extern crate extprim;
use extprim::u128::u128;

const TEN: u128 = u128!(10);
# fn main() {}

Dependencies

~1.4–2MB
~44K SLoC