#radix #str #numbers #convert #static #proc-macro

macro radix_str

use proc_macro convert number radix to static str

1 unstable release

0.1.1 Dec 1, 2023

#66 in #radix

33 downloads per month

Apache-2.0

3KB

radix_str : use proc_macro convert number radix to static str

use radix_str::radix_str;

static TEST0: &str = radix_str!(1234567890, 36);
static TEST1: &str = radix_str!(-1234567890, 36);

#[test]
fn test() {
  assert_eq!(TEST0, "kf12oi");
  assert_eq!(TEST1, "-kf12oi");
  println!("TEST0 = {}", TEST0);
  println!("TEST1 = {}", TEST1);
}

Dependencies

~18KB