stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

Feature request: `set.toggle(...)`

Open Norlock opened this issue 6 months ago • 1 comments
trafficstars

Maybe it would be nice to have QoL function to toggle the key:

pub fn toggle(set: set.Set(a), key: a) {
  case set.contains(set, key) {
    True -> set.delete(set, key)
    False -> set.insert(set, key)
  }
}

Norlock avatar May 19 '25 04:05 Norlock