use num_format

This commit is contained in:
Milo 2021-06-19 08:12:46 +01:00
parent d2f7e0fea4
commit 664cc8c754
5 changed files with 38 additions and 8 deletions

View file

@ -10,6 +10,7 @@ use ide_db::{
RootDatabase,
};
use itertools::Itertools;
use num_format::{Buffer, Locale};
use profile::{memory_usage, Bytes};
use rustc_hash::FxHashMap;
use stdx::format_to;
@ -109,7 +110,8 @@ pub(crate) struct SyntaxTreeStats {
impl fmt::Display for SyntaxTreeStats {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "{} trees, {} preserved", self.total, self.retained)
let buf = Buffer::default().write_formatted(&self.total, &Locale::en);
write!(fmt, "{} trees, {} preserved", buf.to_string(), self.retained)
}
}