File tree Expand file tree Collapse file tree 5 files changed +65
-96
lines changed Expand file tree Collapse file tree 5 files changed +65
-96
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ repository = "https://github.com/mattnenterprise/rust-ftp"
7
7
description = " FTP client for Rust"
8
8
readme = " README.md"
9
9
license = " Apache-2.0/MIT"
10
+ edition = " 2018"
10
11
keywords = [" ftp" ]
11
12
categories = [" network-programming" ]
12
13
@@ -26,10 +27,10 @@ secure = ["openssl"]
26
27
debug_print = []
27
28
28
29
[dependencies ]
29
- lazy_static = " 0.1 "
30
- regex = " 0.1 "
31
- chrono = " 0.2 "
30
+ lazy_static = " 1.4.0 "
31
+ regex = " 1.3.9 "
32
+ chrono = " 0.4.11 "
32
33
33
34
[dependencies .openssl ]
34
- version = " 0.9 "
35
+ version = " 0.10.29 "
35
36
optional = true
Original file line number Diff line number Diff line change @@ -12,26 +12,25 @@ pub enum DataStream {
12
12
Ssl ( SslStream < TcpStream > ) ,
13
13
}
14
14
15
- #[ cfg( feature = "secure" ) ]
16
15
impl DataStream {
17
16
/// Unwrap the stream into TcpStream. This method is only used in secure connection.
18
17
pub fn into_tcp_stream ( self ) -> TcpStream {
19
18
match self {
20
19
DataStream :: Tcp ( stream) => stream,
20
+ #[ cfg( feature = "secure" ) ]
21
21
DataStream :: Ssl ( stream) => stream. get_ref ( ) . try_clone ( ) . unwrap ( ) ,
22
22
}
23
23
}
24
24
25
25
/// Test if the stream is secured
26
26
pub fn is_ssl ( & self ) -> bool {
27
27
match self {
28
+ #[ cfg( feature = "secure" ) ]
28
29
& DataStream :: Ssl ( _) => true ,
29
30
_ => false
30
31
}
31
32
}
32
- }
33
33
34
- impl DataStream {
35
34
/// Returns a reference to the underlying TcpStream.
36
35
pub fn get_ref ( & self ) -> & TcpStream {
37
36
match self {
You can’t perform that action at this time.
0 commit comments