|
pub fn is_palindrome(number: i32) -> bool {
|
|
// Negative numbers can never be a palindrome because of the minus sign.
|
|
if number < 0 {
|
|
return false;
|
|
}
|
|
|
|
let number_string = number.to_string();
|
|
number_string == number_string.chars().rev().collect::<String>()
|
|
}
|