fn data_get_values(student: &HashMap<String, String>) -> Option<(String, Presence)> {
    let mut login = String::new();
    let mut presence: Option<Presence> = None;

    for (key, val) in student {
        if key == "name" {
            login = val.clone();
        }
        if key == "value" {
            presence = Some(Presence::from(val));
        }
    }
    if login.is_empty() || presence.is_none() {
        return None;
    }
    Some((login, presence.unwrap()))
}
/// Get login and presence from hashmap
///
/// Return None if either value is not present
Get login and presence from hashmap
Return None if either value is not present
Get login and presence from hashmap Return None if either value is not present
fn data_get_values(student: &HashMap<String, String>) -> Option<(String, Presence)> {
    let mut login = String::new();
    let mut presence: Option<Presence> = None;
    for (key, val) in student {
        if key == "name" {
            login = val.clone();
        }
        if key == "value" {
            presence = Some(Presence::from(val));
        }
    }
    if login.is_empty() || presence.is_none() {
        return None;
    }
    Some((login, presence.unwrap()))
}
fn data_get_values ( student : & HashMap < String , String > ) -> Option < ( String , Presence ) > { let mut login = String :: new ( ) ; let mut presence : Option < Presence > = None ; for ( key , val ) in student { if key == " " { login = val . clone ( ) ; } if key == " " { presence = Some ( Presence :: from ( val ) ) ; } } if login . is_empty ( ) || presence . is_none ( ) { return None ; } Some ( ( login , presence . unwrap ( ) ) ) }
Get login and presence from hashmap
Return None if either value is not present
Get login and presence from hashmap Return None if either value is not present
student
&HashMap<String, String>
student
&HashMap<String, String>