improve alloc stats interface; fix admin command formatting

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-09 21:55:56 +00:00
parent 2a304c2b6c
commit 16e76d45cb
5 changed files with 20 additions and 24 deletions

View file

@ -632,12 +632,12 @@ pub(super) async fn resolve_true_destination(
pub(super) fn memory_stats() -> RoomMessageEventContent {
let html_body = conduit::alloc::memory_stats();
if html_body.is_empty() {
if html_body.is_none() {
return RoomMessageEventContent::text_plain("malloc stats are not supported on your compiled malloc.");
}
RoomMessageEventContent::text_html(
"This command's output can only be viewed by clients that render HTML.".to_owned(),
html_body,
html_body.expect("string result"),
)
}