Skip to content

Commit bc5fc1e

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 eccc85e commit bc5fc1e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

rosidl_runtime_rs/src/sequence.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,21 @@ macro_rules! impl_sequence_alloc_for_primitive_type {
552552
}
553553

554554
impl SequenceAlloc for $rust_type {
555+
/// Initializes a sequence with a given size.
556+
///
557+
/// # Safety
558+
///
559+
/// This function is unsafe because it calls an unsafe function `$init_func`.
560+
/// The caller must ensure that `$init_func` is safe to call with the provided arguments.
561+
///
562+
/// # Arguments
563+
///
564+
/// * `seq` - A mutable reference to the sequence to be initialized.
565+
/// * `size` - The size of the sequence to be initialized.
566+
///
567+
/// # Returns
568+
///
569+
/// `true` if the sequence was successfully initialized, `false` otherwise.
555570
fn sequence_init(seq: &mut Sequence<Self>, size: usize) -> bool {
556571
// SAFETY: There are no special preconditions to the sequence_init function.
557572

0 commit comments

Comments
 (0)