Skip to content

Commit 0ee9a7f

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 48a511a commit 0ee9a7f

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
@@ -534,6 +534,21 @@ macro_rules! impl_sequence_alloc_for_primitive_type {
534534
}
535535

536536
impl SequenceAlloc for $rust_type {
537+
/// Initializes a sequence with a given size.
538+
///
539+
/// # Safety
540+
///
541+
/// This function is unsafe because it calls an unsafe function `$init_func`.
542+
/// The caller must ensure that `$init_func` is safe to call with the provided arguments.
543+
///
544+
/// # Arguments
545+
///
546+
/// * `seq` - A mutable reference to the sequence to be initialized.
547+
/// * `size` - The size of the sequence to be initialized.
548+
///
549+
/// # Returns
550+
///
551+
/// `true` if the sequence was successfully initialized, `false` otherwise.
537552
fn sequence_init(seq: &mut Sequence<Self>, size: usize) -> bool {
538553
// SAFETY: There are no special preconditions to the sequence_init function.
539554
unsafe {

0 commit comments

Comments
 (0)