From ceeaeed26accbbcf084b54d11e4cdf3f6ff259ad Mon Sep 17 00:00:00 2001 From: Tomas Krejci Date: Tue, 19 Dec 2023 11:32:40 +0100 Subject: [PATCH] Use rfind to locate the @ in connection string --- src/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builder.rs b/src/builder.rs index cfaedb7cd..e0222ad77 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -319,7 +319,7 @@ impl SessionBuilder { let mut port = None; if destination.starts_with("ssh://") { destination = &destination[6..]; - if let Some(at) = destination.find('@') { + if let Some(at) = destination.rfind('@') { // specified a username -- extract it: user = Some(&destination[..at]); destination = &destination[(at + 1)..];