fn first(s: impl core::fmt::Display) -> String {
    let s = s.to_string();
    let l = s
        .split_whitespace()
        .map(ToString::to_string)
        .collect::<Vec<String>>();

    if !l.is_empty() {
        l[0].to_string()
    } else {
        String::from("")
    }
}
/// Get the first word in a string
Get the first word in a string
Get the first word in a string
fn first(s: impl core::fmt::Display) -> String {
    let s = s.to_string();
    let l = s
        .split_whitespace()
        .map(ToString::to_string)
        .collect::<Vec<String>>();
    if !l.is_empty() {
        l[0].to_string()
    } else {
        String::from("")
    }
}
fn first ( s : impl core :: fmt :: Display ) -> String { let s = s . to_string ( ) ; let l = s . split_whitespace ( ) . map ( ToString :: to_string ) . collect :: < Vec < String > > ( ) ; if ! l . is_empty ( ) { l [ 0 ] . to_string ( ) } else { String :: from ( " " ) } }
Get the first word in a string
Get the first word in a string
s
impl core::fmt::Display
s
impl core::fmt::Display