Skip to content

Commit

Permalink
remove redendant code + 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
malik672 committed Jan 11, 2024
1 parent 686d223 commit a06d50f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/utils/sorted_insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn sorted_insert<T: Clone>(

if items.len() > max_size {
return Err(Error::Incorrect(
"items_size has to greater than max_size".to_string(),
"items_size has to lesser than max_size".to_string(),
));
}

Expand Down Expand Up @@ -58,11 +58,11 @@ mod tests {
}

#[test]
#[should_panic(expected = "items_size has to greater than max_size")]
#[should_panic(expected = "items_size has to lesser than max_size")]
fn test_length_greater_than_max_size() {
let mut arr = vec![1, 2];
let _w = sorted_insert(&mut arr, 1, 1, cmp).unwrap();
assert!(_w.is_none(), "items_size has to greater than max_size");
assert!(_w.is_none(), "items_size has to lesser than max_size");
}

#[test]
Expand Down
4 changes: 1 addition & 3 deletions src/utils/sqrt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ use crate::prelude::*;
///
pub fn sqrt(value: &BigInt) -> Result<BigInt, Error> {
if !value >= Zero::zero() {
return Err(Error::Incorrect(
"value has to be greater than -1".to_string(),
));
return Err(Error::Incorrect("value cannot be negative".to_string()));
}

// If the value is less than or equal to MAX_SAFE_INTEGER,
Expand Down

0 comments on commit a06d50f

Please sign in to comment.