/// Does the same thing as `delete_global` but attempts to return the removed variable
Does the same thing as `delete_global` but attempts to return the removed variable
Does the same thing as ` delete_global ` but attempts to return the removed variable
pub fn remove_global<K: AsRef<str>, R: Any>(&mut self, key: K) -> Result<Option<Box<R>>, Trap> {
        match self.globals.remove(key.as_ref()) {
            None => Ok(None),
            Some(val) => Ok(Some(
                val.downcast()
                    .map_err(|_| Trap::DowncastError(type_name::<R>()))?,
            )),
        }
    }
pub fn remove_global < K : AsRef < str > , R : Any > ( & mut self , key : K ) -> Result < Option < Box < R > > , Trap > { match self . globals . remove ( key . as_ref ( ) ) { None => Ok ( None ) , Some ( val ) => Ok ( Some ( val . downcast ( ) . map_err ( | _ | Trap :: DowncastError ( type_name :: < R > ( ) ) ) ? , ) ) , } }
Does the same thing as `delete_global` but attempts to return the removed variable
Does the same thing as ` delete_global ` but attempts to return the removed variable
&mut self
key
K