Skip to content

Commit

Permalink
add TypeCollection::remove for Tauri Specta
Browse files Browse the repository at this point in the history
  • Loading branch information
oscartbeaumont committed Jan 12, 2025
1 parent b993967 commit e695e25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions specta/src/type_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ impl TypeCollection {
self
}

/// Remove a type from the collection.
pub fn remove(&mut self, sid: SpectaID) -> Option<NamedDataType> {
self.map.remove(&sid).flatten()
}

#[track_caller]
pub fn get(&self, sid: SpectaID) -> Option<&NamedDataType> {
#[allow(clippy::bind_instead_of_map)]
Expand Down

0 comments on commit e695e25

Please sign in to comment.