Minor fixes
This commit is contained in:
parent
d971abf1da
commit
db25f7e590
10
src/hash.rs
10
src/hash.rs
@ -444,6 +444,16 @@ impl From<H256> for Address {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<H256> for H64 {
|
||||
fn from(value: H256) -> H64 {
|
||||
unsafe {
|
||||
let mut ret: H64 = ::std::mem::uninitialized();
|
||||
::std::ptr::copy(value.as_ptr().offset(20), ret.as_mut_ptr(), 8);
|
||||
ret
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
impl<'_> From<&'_ H256> for Address {
|
||||
fn from(value: &'_ H256) -> Address {
|
||||
|
@ -355,7 +355,6 @@ impl<Message> Host<Message> where Message: Send {
|
||||
let nonce = self.info.next_nonce();
|
||||
match self.connections.insert_with(|token| ConnectionEntry::Handshake(Handshake::new(token, id, socket, &nonce).expect("Can't create handshake"))) {
|
||||
Some(token) => {
|
||||
warn!(target: "slab", "inserted {}", token.as_usize());
|
||||
match self.connections.get_mut(token) {
|
||||
Some(&mut ConnectionEntry::Handshake(ref mut h)) => {
|
||||
h.start(&self.info, true)
|
||||
@ -536,7 +535,6 @@ impl<Message> Host<Message> where Message: Send {
|
||||
h.disconnected(&mut NetworkContext::new(io, p, Some(token), &mut self.connections, &mut self.timers), &token);
|
||||
}
|
||||
self.connections.remove(Token(token));
|
||||
warn!(target: "slab", "removed {}", token);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user