diff --git a/src/utils/sorted_insert.rs b/src/utils/sorted_insert.rs index 30bd394..44adb61 100644 --- a/src/utils/sorted_insert.rs +++ b/src/utils/sorted_insert.rs @@ -16,7 +16,7 @@ pub fn sorted_insert( 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(), )); } @@ -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] diff --git a/src/utils/sqrt.rs b/src/utils/sqrt.rs index 6e120f0..069b66c 100644 --- a/src/utils/sqrt.rs +++ b/src/utils/sqrt.rs @@ -10,9 +10,7 @@ use crate::prelude::*; /// pub fn sqrt(value: &BigInt) -> Result { 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,