removed legacy code
This commit is contained in:
parent
11411b9d13
commit
67cda61245
@ -132,22 +132,6 @@ impl State {
|
||||
.next()
|
||||
}
|
||||
|
||||
pub fn addr(&self) -> Option<SocketAddr> {
|
||||
self.kv()
|
||||
.iter()
|
||||
.filter(|(key, _)| key == &"endpoint")
|
||||
.map(|(_, value)| value.parse::<SocketAddr>().unwrap())
|
||||
.next()
|
||||
}
|
||||
|
||||
pub fn last_handshake(&self) -> Option<u64> {
|
||||
self.kv()
|
||||
.iter()
|
||||
.filter(|(key, _)| key == &"last_handshake_time_nsec")
|
||||
.map(|(_, value)| value.parse::<u64>().unwrap())
|
||||
.next()
|
||||
}
|
||||
|
||||
pub fn push(&mut self, key: String, value: String) {
|
||||
self.kv_mut().push((key, value));
|
||||
}
|
||||
@ -195,10 +179,13 @@ impl Socket {
|
||||
let key = iter.by_ref().take_while(|c| c != &'=').collect::<String>();
|
||||
let value = iter.collect::<String>();
|
||||
match key.as_ref() {
|
||||
"errno" if value != "0" => Err(Error::new(
|
||||
"errno" if value != "0" => {
|
||||
Err(Error::new(
|
||||
ErrorKind::Other,
|
||||
format!("Socket said error: {}", value),
|
||||
))?,
|
||||
))?;
|
||||
break;
|
||||
},
|
||||
"public_key" | "private_key" => {
|
||||
state.push(cur);
|
||||
cur = if key == "private_key" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user