charon_lib/transform/
update_block_indices.rsuse std::mem;
use derive_visitor::{visitor_enter_fn_mut, DriveMut};
use crate::ids::*;
use crate::transform::TransformCtx;
use crate::ullbc_ast::*;
use super::ctx::UllbcPass;
pub struct Transform;
impl UllbcPass for Transform {
fn transform_body(&self, _ctx: &mut TransformCtx<'_>, b: &mut ExprBody) {
let id_map: Vector<BlockId, BlockId> =
mem::take(&mut b.body).map(|block| b.body.push(block));
b.body
.drive_mut(&mut visitor_enter_fn_mut(|id: &mut BlockId| {
*id = id_map[*id]
}));
}
}