Skip to content

Commit 6972841

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 1baa9d2 commit 6972841

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

rosidl_runtime_rs/src/sequence.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ pub struct SequenceIterator<T: SequenceAlloc> {
9292
// ========================= impl for Sequence =========================
9393

9494
impl<T: SequenceAlloc> Clone for Sequence<T> {
95+
/// Creates a deep copy of the sequence.
96+
///
97+
/// # Panics
98+
///
99+
/// This function will panic if the cloning operation fails, as indicated by the
100+
/// `sequence_copy` function returning `false`.
101+
///
102+
/// # Returns
103+
///
104+
/// A new `Sequence` instance that is a deep copy of the original sequence.
95105
fn clone(&self) -> Self {
96106
let mut seq = Self::default();
97107
if T::sequence_copy(self, &mut seq) {

0 commit comments

Comments
 (0)