aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/status.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/status.rs')
-rw-r--r--crates/ra_ide_api/src/status.rs21
1 files changed, 4 insertions, 17 deletions
diff --git a/crates/ra_ide_api/src/status.rs b/crates/ra_ide_api/src/status.rs
index bd355dd78..e0fc1c123 100644
--- a/crates/ra_ide_api/src/status.rs
+++ b/crates/ra_ide_api/src/status.rs
@@ -22,9 +22,7 @@ pub(crate) fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
22pub(crate) fn status(db: &RootDatabase) -> String { 22pub(crate) fn status(db: &RootDatabase) -> String {
23 let files_stats = db.query(FileTextQuery).entries::<FilesStats>(); 23 let files_stats = db.query(FileTextQuery).entries::<FilesStats>();
24 let syntax_tree_stats = syntax_tree_stats(db); 24 let syntax_tree_stats = syntax_tree_stats(db);
25 let symbols_stats = db 25 let symbols_stats = db.query(LibrarySymbolsQuery).entries::<LibrarySymbolsStats>();
26 .query(LibrarySymbolsQuery)
27 .entries::<LibrarySymbolsStats>();
28 let n_defs = { 26 let n_defs = {
29 let interner: &hir::HirInterner = db.as_ref(); 27 let interner: &hir::HirInterner = db.as_ref();
30 interner.len() 28 interner.len()
@@ -75,11 +73,7 @@ pub(crate) struct SyntaxTreeStats {
75 73
76impl fmt::Display for SyntaxTreeStats { 74impl fmt::Display for SyntaxTreeStats {
77 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { 75 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
78 write!( 76 write!(fmt, "{} trees, {} ({}) retained", self.total, self.retained, self.retained_size,)
79 fmt,
80 "{} trees, {} ({}) retained",
81 self.total, self.retained, self.retained_size,
82 )
83 } 77 }
84} 78}
85 79
@@ -144,20 +138,13 @@ impl MemoryStats {
144 138
145 #[cfg(not(feature = "jemalloc"))] 139 #[cfg(not(feature = "jemalloc"))]
146 fn current() -> MemoryStats { 140 fn current() -> MemoryStats {
147 MemoryStats { 141 MemoryStats { allocated: Bytes(0), resident: Bytes(0) }
148 allocated: Bytes(0),
149 resident: Bytes(0),
150 }
151 } 142 }
152} 143}
153 144
154impl fmt::Display for MemoryStats { 145impl fmt::Display for MemoryStats {
155 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { 146 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
156 write!( 147 write!(fmt, "{} allocated {} resident", self.allocated, self.resident,)
157 fmt,
158 "{} allocated {} resident",
159 self.allocated, self.resident,
160 )
161 } 148 }
162} 149}
163 150