Function collectd_plugin::empty_to_none [] [src]

pub fn empty_to_none(s: &str) -> Option<&str>

Returns if the string is empty or not

Examples

use collectd_plugin::empty_to_none;

assert_eq!(None, empty_to_none(""));

let s = "hi";
assert_eq!(Some("hi"), empty_to_none(s));