Remove a couple unused methods

This commit is contained in:
Igor Katson 2023-11-19 21:06:14 +00:00
parent 0c6781ba4b
commit b891cd40dd
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
2 changed files with 1 additions and 12 deletions

View file

@ -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)),

View file

@ -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
} }