Skip to content

Commit

Permalink
fix doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martial-plains committed Nov 7, 2023
1 parent a49d05a commit a443686
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/search/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ use core::cmp::Ordering;
/// use algorithms::search::binary;
///
/// let arr = [1, 3, 5, 7, 9];
/// assert_eq!(binary(&arr, 5), Some(2));
/// assert_eq!(binary(&arr, &5), Some(2));
///
/// let arr = [1, 3, 5, 7, 9];
/// assert_eq!(binary(&arr, 2), None);
/// assert_eq!(binary(&arr, &2), None);
///
/// let arr: [char; 6] = ['a', 'b', 'c', 'd', 'e', 'f'];
/// assert_eq!(binary(&arr, 'd'), Some(3));
/// assert_eq!(binary(&arr, &'d'), Some(3));
/// ```
///
/// # Performance
Expand Down
4 changes: 2 additions & 2 deletions src/search/exponential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use core::cmp::Ordering;
///
/// let array = [1, 3, 5, 7, 9, 11, 13];
/// let key = 7;
/// let index = exponential(&array, key);
/// let index = exponential(&array, &key);
/// assert_eq!(index, Some(3));
/// ```
///
Expand All @@ -43,7 +43,7 @@ use core::cmp::Ordering;
///
/// let array = [1, 3, 5, 7, 9, 11, 13];
/// let key = 10;
/// let index = exponential(&array, key);
/// let index = exponential(&array, &key);
/// assert_eq!(index, None);
/// ```
///
Expand Down

0 comments on commit a443686

Please sign in to comment.