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: pool.rs
    path of file: ./repos/emu/emu_core/src
    
    the code of the file until where you have to start completion: //! Tools for managing the device pool either implicitly or explicitly
//!
//! If you plan on not really delving into the WebGPU internals of Emu and just want to work 
    
fn maybe_initialize_device_idx() {
    if DEVICE_POOL.is_some() && DEVICE_IDX.with(|idx| idx.borrow().is_none()) {
        if DEVICE_POOL.as_ref().unwrap().len() > 0 {
            // we can only set device index if pool is Some and has length
            DEVICE_IDX.with(|idx| *idx.borrow_mut() = Some(0));
        }
    }
}