Macro serde_json_lodash::to_lower[][src]

macro_rules! to_lower {
    () => { ... };
    ($a:expr $(,)*) => { ... };
    ($a:expr, $($rest:tt)*) => { ... };
}

Description can be found in lodash toLower

Examples:

#[macro_use] extern crate serde_json_lodash;
use serde_json::json;
assert_eq!(
  to_lower!(json!("--Foo-Bar--")),
  json!("--foo-bar--")
);
assert_eq!(
  to_lower!(json!("fooBar")),
  json!("foobar")
);
assert_eq!(
  to_lower!(json!("__FOO_BAR__")),
  json!("__foo_bar__")
);

More examples:

assert_eq!(to_lower!(), json!(""));
assert_eq!(to_lower!(json!(null)), json!(""));
assert_eq!(to_lower!(json!(false)), json!("false"));
assert_eq!(to_lower!(json!(-0)), json!("0")); // rust world -0 is 0
assert_eq!(to_lower!(json!("")), json!(""));
assert_eq!(to_lower!(json!([])), json!(""));
assert_eq!(to_lower!(json!([null,'A',{}])), json!("null,a,serde_json::map::map<alloc::string::string, serde_json::value::value>"));
assert_eq!(to_lower!(json!({})), json!("serde_json::map::map<alloc::string::string, serde_json::value::value>"));