Skip to content

Commit

Permalink
fix typos & test debug str
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajjon committed Dec 9, 2023
1 parent b26341f commit 69a6711
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/identified_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,14 +608,14 @@ where
}
}

/// Removes the given element from the `indentified_vec`.
/// Removes the given element from the `identified_vec`.
///
/// If the element is found in the `indentified_vec`, this method returns the element.
/// If the element is found in the `identified_vec`, this method returns the element.
///
/// If the element isn't found in the `indentified_vec`, `remove` returns `None`.
/// If the element isn't found in the `identified_vec`, `remove` returns `None`.
///
/// - Parameter element: The element to remove.
/// - Returns: The value that was removed, or `None` if the element was not present in the `indentified_vec`.
/// - Returns: The value that was removed, or `None` if the element was not present in the `identified_vec`.
/// - Complexity: O(`count`)
#[inline]
pub fn remove(&mut self, element: &Element) -> Option<Element> {
Expand Down Expand Up @@ -865,6 +865,15 @@ mod tests {
assert_eq!(identified_vec.ids(), &[1, 2, 3])
}

#[test]
fn debug_str() {
let identified_vec = SUT::from_iter([1, 2, 3]);
assert_eq!(
identified_vec.debug_str(),
"order: [1, 2, 3]\nelements: {2: 2, 1: 1, 3: 3}"
)
}

#[test]
fn elements() {
let vec = vec![User::blob(), User::blob_jr(), User::blob_sr()];
Expand Down

0 comments on commit 69a6711

Please sign in to comment.