use std::{
borrow::{Borrow, Cow},
cell::Cell,
+ collections::BTreeMap,
fmt,
hash::Hash,
iter::{FusedIterator, Peekable},
#[derive(Deserialize)]
struct LocSetSerialized {
- starts: EnumMap<LocKind, BigUint>,
- ty: Option<Ty>,
+ reg_len_to_starts_map: BTreeMap<NonZeroU32, EnumMap<LocKind, BigUint>>,
}
impl TryFrom<LocSetSerialized> for LocSet {
type Error = Error;
fn try_from(value: LocSetSerialized) -> Result<Self, Self::Error> {
- Self::from_parts(value.starts, value.ty)
+ Self::from_reg_len_to_starts_map(value.reg_len_to_starts_map)
}
}
#[derive(Clone, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(try_from = "LocSetSerialized")]
pub struct LocSet {
- starts: EnumMap<LocKind, BigUint>,
- ty: Option<Ty>,
+ reg_len_to_starts_map: BTreeMap<NonZeroU32, EnumMap<LocKind, BigUint>>,
}
/// computes same value as `a & !b`, but more efficiently