Function tstr_limit

Source
pub const fn tstr_limit(n: usize) -> usize
Expand description

const function to limit usize value to between 1 and 256. Can be called when tstr is created (under pub-tstr feature):

  #[cfg(feature = "pub-tstr")]
  let ls = tstr::<{tstr_limit(258)}>::from("abcd");
  assert_eq!(ls.capacity(),255);