Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mr-bo-jangles/d3979eada40108df92b4c450d4cfa3a0 to your computer and use it in GitHub Desktop.
Save mr-bo-jangles/d3979eada40108df92b4c450d4cfa3a0 to your computer and use it in GitHub Desktop.
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