NonDeDuplicatedStr

Type Alias NonDeDuplicatedStr 

Source
pub type NonDeDuplicatedStr<const N: usize> = NonDeDuplicatedFlexible<[u8; N], str>;
Expand description

For non-de-duplicated string slices stored in static variables.

Aliased Type§

pub struct NonDeDuplicatedStr<const N: usize> { /* private fields */ }

Implementations§

Source§

impl<const N: usize> NonDeDuplicatedStr<N>

Source

pub const fn new(s: &str) -> Self

Construct a new instance.

Source

pub const fn get(&self) -> &str

Get a reference.

Implementation details: Since this type, and this function, is intended to be used for static variables only, speed doesn’t matter here. So, we use core::str::from_utf8 (instead of core::str::from_utf8_unchecked).