improvements and fixes

This commit is contained in:
elvis
2025-10-27 14:39:11 +01:00
parent 462d0e9d53
commit fbc767a21b
6 changed files with 252 additions and 54 deletions

View File

@ -33,6 +33,7 @@ where
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
fn contains(&self, el: &Self::Element) -> bool;
fn add(&mut self, el: Self::Element);
}
pub trait ExtensionsSet {
@ -140,6 +141,10 @@ impl BasicSet for Set {
fn contains(&self, el: &Self::Element) -> bool {
self.identifiers.contains(el)
}
fn add(&mut self, el: Self::Element) {
self.identifiers.insert(el);
}
}
impl PartialEq for Set {
@ -488,6 +493,10 @@ impl BasicSet for PositiveSet {
false
}
}
fn add(&mut self, el: Self::Element) {
self.identifiers.insert(el.id, el.state);
}
}
impl PrintableWithTranslator for PositiveSet {