Macro ccase
#[macro_export]
macro_rules! ccase {
($case:ident, $e:expr) => { ... };
($from:ident -> $to:ident, $e:expr) => { ... };
}
Convert an identifier into a case.
The macro can be used as follows.
use ccase;
assert_eq!;
// equivalent to
// "myVarName".to_case(Case::Snake)
You can also specify a from case, or the case that determines how the input string is split into words.
use ccase;
assert_eq!;
// equivalent to
// "Ice-cream sales".from_case(Case::Sentence).to_case(Case::Snake)