client-api: Fix unnecessary allocation in URL construction

This commit is contained in:
Jonas Platte 2021-12-18 20:05:28 +01:00
parent 2f732bf9c2
commit 57e84f862b
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -78,8 +78,8 @@ impl<'a> ruma_api::OutgoingRequest for Request<'a> {
let mut url = format!(
"{}/_matrix/client/r0/rooms/{}/state/{}",
base_url.strip_suffix('/').unwrap_or(base_url),
utf8_percent_encode(&self.room_id.to_string(), NON_ALPHANUMERIC),
utf8_percent_encode(&self.event_type.to_string(), NON_ALPHANUMERIC)
utf8_percent_encode(self.room_id.as_str(), NON_ALPHANUMERIC),
utf8_percent_encode(self.event_type.as_str(), NON_ALPHANUMERIC)
);
if !self.state_key.is_empty() {