From a111db26bb2f6a355cb337517011456bfb2e642b Mon Sep 17 00:00:00 2001 From: Vaivaswatha Nagaraj Date: Mon, 8 Jul 2024 14:15:06 +0530 Subject: [PATCH] update docs for VecExtns --- src/utils/vec_exns.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/utils/vec_exns.rs b/src/utils/vec_exns.rs index e1d45f5..dc9cecc 100644 --- a/src/utils/vec_exns.rs +++ b/src/utils/vec_exns.rs @@ -1,14 +1,16 @@ //! Extend functionality of Rust vectors. +/// This trait provides additionaly functionality for Rust vectors pub trait VecExtns { - // Insert a new element and get back its index in the container. + /// Insert a new element and get back its index in the container. fn push_back(&mut self, t: T) -> usize; - // Insert a new element, constructed by calling `ctor`, - // and get back its index in the container. `ctor` will - // receve the index as a parameter. This is useful when the - // element inserted needs to know its index. + /// Insert a new element, constructed by calling `ctor`, + /// and get back its index in the container. `ctor` will + /// receve the index as a parameter. This is useful when the + /// element inserted needs to know its index. fn push_back_with(&mut self, ctor: impl FnMut(usize) -> T) -> usize; - // Create and initialize a new vector. + + /// Create and initialize a new vector. fn new_init T>(size: usize, initf: U) -> Vec; }