I have this function which calculates number of digits in an Integer. This function can have two variants, i.e., signed numbers and unsigned numbers, the implementations are defined for both variants respectively below.

```
fn number_of_digits<T: Integer + Copy + NumCast>(mut num: T) -> T where T: Signed{
let TEN: T = NumCast::from(10).unwrap();
if num < T::zero() {
num =-num;
}
let mut sum = T::zero();
while num >= TEN {
sum = sum + T::one();
num = num % TEN;
}
sum + T::one()
}
fn number_of_digits<T: Integer + Copy + NumCast>(mut num: T) -> T where T: UnSigned{
let TEN: T = NumCast::from(10).unwrap();
let mut sum = T::zero();
while num >= TEN {
sum = sum + T::one();
num = num % TEN;
}
sum + T::one()
}
```

So, how do I rewrite the function so that it can have respective implementations for both signed and unsigned without any compiler error?

And also in this line (`let TEN: T = NumCast::from(10).unwrap();`

) inside the number_of_digits function, I initially used const keyword but it is giving me this compiler error. So, how to use `const`

here instead of `let`

?