Skip to main content

separator

Macro separator 

Source
macro_rules! separator {
    ($delim:expr) => { ... };
}
Expand description

Create a new boundary based on a string.

This is shorthand for creating a boundary that splits on a specific string, and omits that string from the list of words. For more information, see Boundary.

let conv = Converter::new()
    .set_boundaries(&[separator!("::")])
    .to_case(Case::Camel);

assert_eq!(
    conv.convert("my::var::name"),
    "myVarName",
)