remove unneeded ifs

This commit is contained in:
Milo 2021-06-28 17:52:57 +01:00
parent 2e60908fde
commit 443d2164ef

View file

@ -42,15 +42,7 @@ pub(crate) fn status(db: &RootDatabase, file_id: Option<FileId>) -> String {
format_to!(buf, "{} (Macros)\n", macro_syntax_tree_stats(db)); format_to!(buf, "{} (Macros)\n", macro_syntax_tree_stats(db));
format_to!(buf, "{} in total\n", memory_usage()); format_to!(buf, "{} in total\n", memory_usage());
if env::var("RA_COUNT").is_ok() { if env::var("RA_COUNT").is_ok() {
format_to!( format_to!(buf, "\nCounts:\n{}", count.to_string());
buf,
"\nCounts:\n{}",
if count.to_string().contains("all counts are zero") {
String::from("All counts are zero\n")
} else {
count.to_string()
}
);
} }
if let Some(file_id) = file_id { if let Some(file_id) = file_id {