Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
craigmayhew committed Mar 20, 2024
1 parent 0a2deba commit 8c1c29a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/cruncher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ mod numerics_to_text {
/// # Return a bool depending on the string being palindromic
pub fn is_palindrome(string: &str) -> bool {
let mut i = 0;
let mut j = string.len()-1;
let mut j = string.len() - 1;
while i < j {
if &string.as_bytes()[i] != &string.as_bytes()[j] {
return false;
Expand Down Expand Up @@ -923,7 +923,10 @@ mod tests {
#[test]
fn is_palindrome_test() {
assert_eq!(numerics_to_text::is_palindrome("9003"), false);
assert_eq!(numerics_to_text::is_palindrome("11111111111111122222222223333339003"), false);
assert_eq!(
numerics_to_text::is_palindrome("11111111111111122222222223333339003"),
false
);
assert_eq!(numerics_to_text::is_palindrome("0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"), false);
assert_eq!(numerics_to_text::is_palindrome("1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"), true);
assert_eq!(numerics_to_text::is_palindrome("22322"), true);
Expand Down

0 comments on commit 8c1c29a

Please sign in to comment.