@@ -569,7 +569,6 @@ macro_rules! impl_sequence_alloc_for_primitive_type {
569569 /// `true` if the sequence was successfully initialized, `false` otherwise.
570570 fn sequence_init( seq: & mut Sequence <Self >, size: usize ) -> bool {
571571 // SAFETY: There are no special preconditions to the sequence_init function.
572-
573572 unsafe {
574573 if !seq. data. is_null( ) {
575574 // Zero memory, since it will be uninitialized if there is no default value
@@ -578,6 +577,7 @@ macro_rules! impl_sequence_alloc_for_primitive_type {
578577 $init_func( seq as * mut _, size)
579578 }
580579 }
580+
581581 /// Finalizes a sequence, freeing any associated resources.
582582 ///
583583 /// # Safety
@@ -592,6 +592,22 @@ macro_rules! impl_sequence_alloc_for_primitive_type {
592592 // SAFETY: There are no special preconditions to the sequence_fini function.
593593 unsafe { $fini_func( seq as * mut _) }
594594 }
595+
596+ /// Copies the contents of one sequence to another.
597+ ///
598+ /// # Safety
599+ ///
600+ /// This function is unsafe because it calls an unsafe function `$copy_func`.
601+ /// The caller must ensure that `$copy_func` is safe to call with the provided arguments.
602+ ///
603+ /// # Arguments
604+ ///
605+ /// * `in_seq` - A reference to the sequence to be copied from.
606+ /// * `out_seq` - A mutable reference to the sequence to be copied to.
607+ ///
608+ /// # Returns
609+ ///
610+ /// `true` if the copy was successful, `false` otherwise.
595611 fn sequence_copy( in_seq: & Sequence <Self >, out_seq: & mut Sequence <Self >) -> bool {
596612 // SAFETY: There are no special preconditions to the sequence_copy function.
597613 unsafe { $copy_func( in_seq as * const _, out_seq as * mut _) }
0 commit comments