Skip to content

Commit

Permalink
Use is_none_or (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur authored Jan 18, 2025
1 parent 38e1a97 commit c7039ba
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/core/common_conditions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ pub fn server_running(server: Option<Res<RepliconServer>>) -> bool {
/// Can be used instead of the regular [`server_running`] to seamlessly support
/// singleplayer or listen-server mode (where server is also a player).
pub fn server_or_singleplayer(client: Option<Res<RepliconClient>>) -> bool {
let Some(client) = client else {
return true;
};
client.is_disconnected()
client.is_none_or(|client| client.is_disconnected())
}

/// Returns `true` when the client is connecting.
Expand Down

0 comments on commit c7039ba

Please sign in to comment.