mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Use send_fallible
in notify_client
implementation to document that any errors are ignored (and use if let
instead of map
)
This commit is contained in:
parent
f1b6805c65
commit
87815b4615
@ -140,6 +140,7 @@ impl Client {
|
||||
}*/
|
||||
}
|
||||
|
||||
/// Like `send` but any errors are explicitly ignored.
|
||||
pub(crate) fn send_fallible<M: Into<ServerMsg>>(&self, msg: M) { let _ = self.send(msg); }
|
||||
|
||||
pub(crate) fn send_prepared(&self, msg: &PreparedMsg) -> Result<(), StreamError> {
|
||||
|
@ -1172,11 +1172,12 @@ impl Server {
|
||||
where
|
||||
S: Into<ServerMsg>,
|
||||
{
|
||||
self.state
|
||||
if let Some(client) = self.state
|
||||
.ecs()
|
||||
.read_storage::<Client>()
|
||||
.get(entity)
|
||||
.map(|c| c.send(msg));
|
||||
.get(entity) {
|
||||
client.send_fallible(msg);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn notify_players(&mut self, msg: ServerGeneral) { self.state.notify_players(msg); }
|
||||
|
Loading…
Reference in New Issue
Block a user