Macro to_fixedstr

Source
macro_rules! to_fixedstr {
    ($ty_size:ty, $x:expr) => { ... };
}
Expand description

Macro for converting any expression that implements the Display trait into the specified type, similar to to_string but without necessary heap allocation. Truncation is automatic and silent. Example:

  let fs = to_fixedstr!(str8,-0132*2);
  assert_eq!(&fs,"-264");

For version that does not truncate, use convert_to_str!.