Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-29 06:20:29 +01:00
Remove unwrap in connection_lost
Dieser Commit ist enthalten in:
Ursprung
8b3e87cfe0
Commit
3d36ac4601
1 geänderte Dateien mit 4 neuen und 6 gelöschten Zeilen
|
@ -219,7 +219,6 @@ impl Factory for WSFactory {
|
||||||
type Handler = WSHandler;
|
type Handler = WSHandler;
|
||||||
|
|
||||||
fn connection_made(&mut self, out: Sender) -> Self::Handler {
|
fn connection_made(&mut self, out: Sender) -> Self::Handler {
|
||||||
println!("WS: Connection made");
|
|
||||||
WSHandler {
|
WSHandler {
|
||||||
out,
|
out,
|
||||||
user_uuid: None,
|
user_uuid: None,
|
||||||
|
@ -228,12 +227,11 @@ impl Factory for WSFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn connection_lost(&mut self, handler: Self::Handler) {
|
fn connection_lost(&mut self, handler: Self::Handler) {
|
||||||
println!("WS: Connection lost");
|
|
||||||
|
|
||||||
// Remove handler
|
// Remove handler
|
||||||
let user_uuid = &handler.user_uuid.unwrap();
|
if let Some(user_uuid) = &handler.user_uuid {
|
||||||
if let Some(mut user_conn) = self.users.map.get_mut(user_uuid) {
|
if let Some(mut user_conn) = self.users.map.get_mut(user_uuid) {
|
||||||
user_conn.remove_item(&handler.out);
|
user_conn.remove_item(&handler.out);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Laden …
In neuem Issue referenzieren