Use PeerId in TestServer::disconnect_client

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra
2022-10-18 19:05:37 +02:00
co-authored by Nathan Sobo
parent 6146923dbb
commit 0c0e8688ed
3 changed files with 45 additions and 30 deletions
+8
View File
@@ -319,6 +319,14 @@ impl Client {
.map(|credentials| credentials.user_id)
}
pub fn peer_id(&self) -> Option<PeerId> {
if let Status::Connected { peer_id, .. } = &*self.status().borrow() {
Some(*peer_id)
} else {
None
}
}
pub fn status(&self) -> watch::Receiver<Status> {
self.state.read().status.1.clone()
}