Function konst::string::eq_str

source ·
pub const fn eq_str(left: &str, right: &str) -> bool
Expand description

A const equivalent of &str equality comparison.

§Example

use konst::eq_str;

const FOO: &str = "foo";
const BAR: &str = "fooooo";
const BAZ: &str = "bar";


const FOO_EQ_FOO: bool = eq_str(FOO, FOO);
assert!( FOO_EQ_FOO );

const FOO_EQ_BAR: bool = eq_str(FOO, BAR);
assert!( !FOO_EQ_BAR );

const FOO_EQ_BAZ: bool = eq_str(FOO, BAZ);
assert!( !FOO_EQ_BAZ );