xmpp-parsers: Reduce component handshake allocations

This function always appends to an existing string, so by passing it a
String directly we can avoid superfluous allocations.

Also tokio-xmpp was doing a bunch of &str to String for no reason around
there, let’s remove that too.
This commit is contained in:
Emmanuel Gil Peyrot 2025-02-10 15:30:08 +01:00 committed by pep
commit c497967b1c
4 changed files with 14 additions and 10 deletions

View file

@ -87,7 +87,6 @@ impl<C: ServerConnector> Component<C> {
timeouts: Timeouts,
) -> Result<Self, Error> {
let jid = Jid::from_str(jid)?;
let password = password.to_owned();
let stream = component_login(connector, jid.clone(), password, timeouts).await?;
Ok(Component { jid, stream })
}