refactor: simplify raw_string creation

This commit is contained in:
electria 2026-10-02 13:09:43 -07:00
commit ef9d07923e
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs

View file

@ -46,7 +46,7 @@ fn test_character_readdition() {
} }
pub fn get_significant_digits(n: &Float) -> usize { pub fn get_significant_digits(n: &Float) -> usize {
let raw_string: String = format!("{n}").chars().filter(|c| *c != '.').collect(); let raw_string = n.to_string().replace('.', "");
let mut consecutive_zeros = 0; let mut consecutive_zeros = 0;
let mut consecutive_nines = 0; let mut consecutive_nines = 0;