Add the given item to this sequence of flags. If the item was added successfully, then `None` is returned. If the given item is a duplicate, then `Some(i)` is returned, where `items[i].kind == item.kind`.
(&mut self, item: FlagsItem)
| 1281 | /// given item is a duplicate, then `Some(i)` is returned, where |
| 1282 | /// `items[i].kind == item.kind`. |
| 1283 | pub fn add_item(&mut self, item: FlagsItem) -> Option<usize> { |
| 1284 | for (i, x) in self.items.iter().enumerate() { |
| 1285 | if x.kind == item.kind { |
| 1286 | return Some(i); |
| 1287 | } |
| 1288 | } |
| 1289 | self.items.push(item); |
| 1290 | None |
| 1291 | } |
| 1292 | |
| 1293 | /// Returns the state of the given flag in this set. |
| 1294 | /// |
no test coverage detected