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:
parent
b8f64037a9
commit
c497967b1c
4 changed files with 14 additions and 10 deletions
|
|
@ -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 })
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue