Skip to content

Commit

Permalink
Use rfind to locate the @ in connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas789 committed Dec 19, 2023
1 parent 9a1856c commit ceeaeed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)..];
Expand Down

0 comments on commit ceeaeed

Please sign in to comment.