Skip to content

Commit ff2242a

Browse files
committed
Update code to 2018 edition, upgraded all dependencies, replaced try! with ?, and removed deprecated Error methods
1 parent f0e4717 commit ff2242a

File tree

5 files changed

+65
-96
lines changed

5 files changed

+65
-96
lines changed

Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ repository = "https://github.com/mattnenterprise/rust-ftp"
77
description = "FTP client for Rust"
88
readme = "README.md"
99
license = "Apache-2.0/MIT"
10+
edition = "2018"
1011
keywords = ["ftp"]
1112
categories = ["network-programming"]
1213

@@ -26,10 +27,10 @@ secure = ["openssl"]
2627
debug_print = []
2728

2829
[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"
3233

3334
[dependencies.openssl]
34-
version = "0.9"
35+
version = "0.10.29"
3536
optional = true

src/data_stream.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,25 @@ pub enum DataStream {
1212
Ssl(SslStream<TcpStream>),
1313
}
1414

15-
#[cfg(feature = "secure")]
1615
impl DataStream {
1716
/// Unwrap the stream into TcpStream. This method is only used in secure connection.
1817
pub fn into_tcp_stream(self) -> TcpStream {
1918
match self {
2019
DataStream::Tcp(stream) => stream,
20+
#[cfg(feature = "secure")]
2121
DataStream::Ssl(stream) => stream.get_ref().try_clone().unwrap(),
2222
}
2323
}
2424

2525
/// Test if the stream is secured
2626
pub fn is_ssl(&self) -> bool {
2727
match self {
28+
#[cfg(feature = "secure")]
2829
&DataStream::Ssl(_) => true,
2930
_ => false
3031
}
3132
}
32-
}
3333

34-
impl DataStream {
3534
/// Returns a reference to the underlying TcpStream.
3635
pub fn get_ref(&self) -> &TcpStream {
3736
match self {

0 commit comments

Comments
 (0)