Remove a couple unused methods
This commit is contained in:
parent
0c6781ba4b
commit
b891cd40dd
2 changed files with 1 additions and 12 deletions
|
|
@ -144,14 +144,6 @@ impl PeerState {
|
||||||
self.get_live_mut()
|
self.get_live_mut()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn dead_to_queued(&mut self) -> bool {
|
|
||||||
if let PeerState::Dead = self {
|
|
||||||
*self = PeerState::Queued;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn to_dead(&mut self) -> Option<Option<LivePeerState>> {
|
pub fn to_dead(&mut self) -> Option<Option<LivePeerState>> {
|
||||||
match std::mem::replace(self, PeerState::Dead) {
|
match std::mem::replace(self, PeerState::Dead) {
|
||||||
PeerState::Live(l) => Some(Some(l)),
|
PeerState::Live(l) => Some(Some(l)),
|
||||||
|
|
|
||||||
|
|
@ -137,9 +137,6 @@ impl PeerStates {
|
||||||
.flatten()
|
.flatten()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add(&self, addr: SocketAddr) -> Option<PeerHandle> {
|
|
||||||
self.add_if_not_seen(addr)
|
|
||||||
}
|
|
||||||
pub fn mark_peer_dead(&self, handle: PeerHandle) -> Option<Option<LivePeerState>> {
|
pub fn mark_peer_dead(&self, handle: PeerHandle) -> Option<Option<LivePeerState>> {
|
||||||
self.with_peer_mut(handle, "mark_peer_dead", |peer| peer.state.to_dead())
|
self.with_peer_mut(handle, "mark_peer_dead", |peer| peer.state.to_dead())
|
||||||
.flatten()
|
.flatten()
|
||||||
|
|
@ -810,7 +807,7 @@ impl TorrentState {
|
||||||
None => return false,
|
None => return false,
|
||||||
};
|
};
|
||||||
|
|
||||||
let _ = self.peer_queue_tx.send(addr);
|
self.peer_queue_tx.send(addr).unwrap();
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue