Skip to content

Commit 9483392

Browse files
committed
remove dependency on rustc-serialize
closes #36
1 parent af37d5c commit 9483392

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

Cargo.lock

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ unix-daemonize = "^0.1"
3636
num-bigint = "^0.1"
3737
num-traits = "^0.1"
3838
byteorder = "^1"
39-
rustc-serialize = "^0.3"
39+
hex = "^0.2"
4040
lazy_static = "^0.2"
4141
ring = "^0.9.4"
4242
time = "^0.1"

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ extern crate num_traits;
1313
extern crate udt;
1414
extern crate ring;
1515
extern crate time;
16-
extern crate rustc_serialize;
1716
extern crate colored;
17+
extern crate hex;
1818

1919
// crates needed for unit tests
2020
#[cfg(test)]
@@ -29,6 +29,7 @@ use byteorder::{ReadBytesExt, WriteBytesExt, LittleEndian};
2929
use colored::*;
3030
use connection::{PortRange, Transceiver};
3131
use log::{LogRecord, LogLevel, LogMetadata};
32+
use hex::ToHex;
3233
use std::net::{SocketAddr, IpAddr};
3334
use std::fs::File;
3435
use std::io;
@@ -39,7 +40,6 @@ use std::str::FromStr;
3940
use std::sync::mpsc;
4041
use std::time::{Instant, Duration};
4142
use progress::Progress;
42-
use rustc_serialize::hex::ToHex;
4343
use unix_daemonize::{daemonize_redirect, ChdirMode};
4444
use file::ReadMsg;
4545

src/ssh.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
extern crate rustc_serialize;
2-
31
use connection::PortRange;
42
use std::collections::HashMap;
53
use std::io;
64
use std::net::SocketAddr;
75
use std::path::PathBuf;
86
use std::process::{Command, Output};
97
use std::str::FromStr;
10-
use rustc_serialize::hex::FromHex;
8+
use hex::FromHex;
119

1210
lazy_static! {
1311
static ref SECURE_OPTS_MAP: HashMap<&'static str, &'static str> = {
@@ -166,8 +164,7 @@ impl Connection {
166164
"unsupported protocol version"));
167165
}
168166

169-
let mut keybytes = Vec::with_capacity(32);
170-
keybytes.extend_from_slice(&keyhex.from_hex().unwrap()[..]);
167+
let keybytes = Vec::<u8>::from_hex(keyhex).unwrap();
171168
let addr: SocketAddr = try!(SocketAddr::from_str(&format!("{}:{}", ip, port)[..])
172169
.map_err(|_| {
173170
Error::new(ErrorType::BadServerResponse,

0 commit comments

Comments
 (0)