pub fn unshare(&mut self, id: &'_ mut CtxId) -> &mut CtxBuf {
    let mut ctx = &mut self[id.0];
    if u32::try_from(ctx.vars.len()).expect("overflow") == id.1 {
      /// Safety: NLL case 3 (polonius validates this borrow pattern)
      #[allow(clippy::useless_transmute)]
      unsafe { std::mem::transmute::<&mut CtxBuf, &mut CtxBuf>(ctx) }
    } else {
      let buf_id = CtxBufId(self.0.len().try_into().expect("overflow"));
      self.0.push(CtxBuf {parent: *id, vars: vec![]});
      *id = CtxId(buf_id, 1);
      unwrap_unchecked!(self.0.last_mut())
    }
  }
/// Given a context ID, retrieve a context buffer, ensuring that it can be directly extended by
/// allocating a new context buffer if necessary.
Given a context ID, retrieve a context buffer, ensuring that it can be directly extended by
allocating a new context buffer if necessary.
Given a context ID retrieve a context buffer ensuring that it can be directly extended by allocating a new context buffer if necessary .
pub fn unshare(&mut self, id: &'_ mut CtxId) -> &mut CtxBuf {
    let mut ctx = &mut self[id.0];
    if u32::try_from(ctx.vars.len()).expect("overflow") == id.1 {
      /// Safety: NLL case 3 (polonius validates this borrow pattern)
      #[allow(clippy::useless_transmute)]
      unsafe { std::mem::transmute::<&mut CtxBuf, &mut CtxBuf>(ctx) }
    } else {
      let buf_id = CtxBufId(self.0.len().try_into().expect("overflow"));
      self.0.push(CtxBuf {parent: *id, vars: vec![]});
      *id = CtxId(buf_id, 1);
      unwrap_unchecked!(self.0.last_mut())
    }
  }
pub fn unshare ( & mut self , id : & ' _ mut CtxId ) -> & mut CtxBuf { let mut ctx = & mut self [ id . 0 ] ; if u32 :: try_from ( ctx . vars . len ( ) ) . expect ( " " ) == id . 1 { /// Safety: NLL case 3 (polonius validates this borrow pattern) # [ allow ( clippy useless_transmute ) ] unsafe { std :: mem :: transmute :: < & mut CtxBuf , & mut CtxBuf > ( ctx ) } } else { let buf_id = CtxBufId ( self . 0 . len ( ) . try_into ( ) . expect ( " " ) ) ; self . 0 . push ( CtxBuf { parent : * id , vars : vec ! [ ] } ) ; * id = CtxId ( buf_id , 1 ) ; unwrap_unchecked ! ( self 0 last_mut ( ) ) } }
Given a context ID, retrieve a context buffer, ensuring that it can be directly extended by
allocating a new context buffer if necessary.
Given a context ID retrieve a context buffer ensuring that it can be directly extended by allocating a new context buffer if necessary .
&mut self
id
&'_ mut CtxId
&mut self
id
&'_ mut CtxId