Created
July 1, 2017 16:22
-
-
Save mr-bo-jangles/d3979eada40108df92b4c450d4cfa3a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn update_last_seen(last_seen_hash: &mut HashMap<String, SystemTime>, nickname: &str) { | |
let time_now = SystemTime::now(); | |
let mut last_seen_entry = last_seen_hash.entry(String::from(nickname)).or_insert(time_now); | |
*last_seen_entry = time_now; | |
println!("Updating {} in the last seen DB at {:?}", nickname, time_now); | |
println!("I'm now tracking {:?} people", last_seen_hash.len()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment