Use integrated error instead of panic on some legacy codepaths

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-04-26 23:01:21 +00:00 committed by Jade Ellis
commit 732a77f3a8
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
6 changed files with 49 additions and 89 deletions

View file

@ -351,8 +351,7 @@ pub(crate) async fn register_route(
if !services.globals.new_user_displayname_suffix().is_empty()
&& body.appservice_info.is_none()
{
write!(displayname, " {}", services.server.config.new_user_displayname_suffix)
.expect("should be able to write to string buffer");
write!(displayname, " {}", services.server.config.new_user_displayname_suffix)?;
}
services
@ -370,8 +369,7 @@ pub(crate) async fn register_route(
content: ruma::events::push_rules::PushRulesEventContent {
global: push::Ruleset::server_default(&user_id),
},
})
.expect("to json always works"),
})?,
)
.await?;