Skip to content

Commit b23a8a6

Browse files
authored
Merge pull request #95 from openssh-rust/rm-lazystatic
Rm lazystatic used in testing
2 parents 07c47fb + 3af5c42 commit b23a8a6

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ dirs = "4.0.0"
5353
openssh-mux-client = { version = "0.15.0", optional = true }
5454

5555
[dev-dependencies]
56-
lazy_static = "1.4.0"
5756
regex = "1"
5857
tokio = { version = "1", features = [ "full" ] }
5958
openssh-sftp-client = "0.11.0"

tests/openssh.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use lazy_static::lazy_static;
1+
use once_cell::sync::Lazy;
22
use regex::Regex;
33
use std::env;
44
use std::io;
@@ -136,12 +136,12 @@ struct ProtoUserHostPort<'a> {
136136
}
137137

138138
fn parse_user_host_port(s: &str) -> Option<ProtoUserHostPort> {
139-
lazy_static! {
140-
static ref SSH_REGEX: Regex = Regex::new(
141-
r"(?x)^((?P<proto>[[:alpha:]]+)://)?((?P<user>.*?)@)?(?P<host>.*?)(:(?P<port>\d+))?$"
139+
static SSH_REGEX: Lazy<Regex> = Lazy::new(|| {
140+
Regex::new(
141+
r"(?x)^((?P<proto>[[:alpha:]]+)://)?((?P<user>.*?)@)?(?P<host>.*?)(:(?P<port>\d+))?$",
142142
)
143-
.unwrap();
144-
}
143+
.unwrap()
144+
});
145145

146146
SSH_REGEX.captures(s).map(|cap| ProtoUserHostPort {
147147
proto: cap.name("proto").map(|m| m.as_str()),
@@ -579,7 +579,7 @@ async fn process_exit_on_signal() {
579579
assert!(matches!(failed, Error::RemoteProcessTerminated));
580580

581581
// the connection should still work though
582-
let _ = session.check().await.unwrap();
582+
session.check().await.unwrap();
583583
}
584584
}
585585

0 commit comments

Comments
 (0)