You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: events.rs
    path of file: ./repos/rustrogueliketutorial/chapter-73-systems/src/gamelog
    
    the code of the file until where you have to start completion: use std::collections::HashMap;
use std::sync::Mutex;


    
pub fn record_event<T: ToString>(event: T, n : i32) {
    let event_name = event.to_string();
    let mut events_lock = EVENTS.lock();
    let events = events_lock.as_mut().unwrap();
    if let Some(e) = events.get_mut(&event_name) {
        *e += n;
    } else {
        events.insert(event_name, n);
    }
}