Use a generic implementation pub struct GenericCtx<T> { bounds: Vec<Vec<T>> } for contexts. This allows to remove some duplication, e.g. the implementation of idx_to_lvl and lvl_to_idx was the same for all 4 contexts, but the code couldn't be shared before.
Use a generic implementation
pub struct GenericCtx<T> { bounds: Vec<Vec<T>> }
for contexts. This allows to remove some duplication, e.g. the implementation ofidx_to_lvl
andlvl_to_idx
was the same for all 4 contexts, but the code couldn't be shared before.