File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ dirs = "4.0.0"
53
53
openssh-mux-client = { version = " 0.15.0" , optional = true }
54
54
55
55
[dev-dependencies ]
56
- lazy_static = " 1.4.0"
57
56
regex = " 1"
58
57
tokio = { version = " 1" , features = [ " full" ] }
59
58
openssh-sftp-client = " 0.11.0"
Original file line number Diff line number Diff line change 1
- use lazy_static :: lazy_static ;
1
+ use once_cell :: sync :: Lazy ;
2
2
use regex:: Regex ;
3
3
use std:: env;
4
4
use std:: io;
@@ -136,12 +136,12 @@ struct ProtoUserHostPort<'a> {
136
136
}
137
137
138
138
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+))?$" ,
142
142
)
143
- . unwrap( ) ;
144
- }
143
+ . unwrap ( )
144
+ } ) ;
145
145
146
146
SSH_REGEX . captures ( s) . map ( |cap| ProtoUserHostPort {
147
147
proto : cap. name ( "proto" ) . map ( |m| m. as_str ( ) ) ,
@@ -579,7 +579,7 @@ async fn process_exit_on_signal() {
579
579
assert ! ( matches!( failed, Error :: RemoteProcessTerminated ) ) ;
580
580
581
581
// the connection should still work though
582
- let _ = session. check ( ) . await . unwrap ( ) ;
582
+ session. check ( ) . await . unwrap ( ) ;
583
583
}
584
584
}
585
585
You can’t perform that action at this time.
0 commit comments