Skip to content

Commit 8c8d1b0

Browse files
committed
feat: add more methods to VecSpan
1 parent 8aa51b6 commit 8c8d1b0

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

libdd-trace-utils/src/span/vec_map.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,19 @@ impl<K, V> VecMap<K, V> {
183183
pub fn is_deduped(&self) -> bool {
184184
self.deduped
185185
}
186+
187+
#[inline]
188+
pub fn clear(&mut self) {
189+
self.data.clear()
190+
}
191+
192+
#[inline]
193+
pub fn drain<R: std::ops::RangeBounds<usize>>(
194+
&mut self,
195+
range: R,
196+
) -> std::vec::Drain<'_, (K, V)> {
197+
self.data.drain(range)
198+
}
186199
}
187200

188201
impl<K: Eq + Hash, V> VecMap<K, V> {

0 commit comments

Comments
 (0)