Trait easy_shortcuts::traits::MaybeTrim
[−]
[src]
pub trait MaybeTrim { fn trim(self) -> Option<(String, String)>; }
trims pairs of strings, passes through None
Required Methods
fn trim(self) -> Option<(String, String)>
this operates on pairs of strings that may be empty and creates a pair of trimmed strings if possible.
It's designed to work with methods like split_at_delim
use easy_shortcuts::traits::*; let s = " one = two ".split_at_delim('=').trim(); assert_eq!(s,Some(("one".to_string(),"two".to_string())));