Skip to content

Commit 1e0787b

Browse files
author
GueLaKais
committed
Added comments to Function
To be honest, I still don't understand exactly what's happening here. All I know is that it's at least somewhat understandable what's going on here.
1 parent 6972841 commit 1e0787b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

rosidl_runtime_rs/src/sequence.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,22 @@ impl<T: SequenceAlloc> Drop for Sequence<T> {
150150
impl<T: SequenceAlloc + Eq> Eq for Sequence<T> {}
151151

152152
impl<T: SequenceAlloc> Extend<T> for Sequence<T> {
153+
/// Extends the sequence by appending elements from an iterator.
154+
///
155+
/// # Arguments
156+
///
157+
/// * `&mut self` - The mutable sequence to be extended.
158+
/// * `iter` - The iterator containing the elements to be appended.
159+
///
160+
/// # Panics
161+
///
162+
/// This function does not panic.
163+
///
164+
/// # Safety
165+
///
166+
/// This function is safe to call, but it may reallocate the underlying memory
167+
/// of the sequence, which could potentially invalidate any existing references
168+
/// or pointers to the sequence's elements.
153169
fn extend<I>(&mut self, iter: I)
154170
where
155171
I: IntoIterator<Item = T>,

0 commit comments

Comments
 (0)