aboutsummaryrefslogtreecommitdiff
path: root/src/matchmaking.rs
diff options
context:
space:
mode:
authorMatthew Collins <[email protected]>2020-09-02 20:16:20 +0100
committerMatthew Collins <[email protected]>2020-09-02 20:16:20 +0100
commit8ded00a828d25e48bc0782e116c5e084cd42ecc3 (patch)
tree01b6d6ce278708fd56245e4ab473bbeda19b9083 /src/matchmaking.rs
parentUse `Fn` instead of `FnMut` for call results as they will be called at most once (diff)
downloadsteamworks-rs-8ded00a828d25e48bc0782e116c5e084cd42ecc3.tar.xz
steamworks-rs-8ded00a828d25e48bc0782e116c5e084cd42ecc3.zip
Use FnOnce instead of Fn for callresults
Diffstat (limited to 'src/matchmaking.rs')
-rw-r--r--src/matchmaking.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/matchmaking.rs b/src/matchmaking.rs
index 3145e2f..056d5ca 100644
--- a/src/matchmaking.rs
+++ b/src/matchmaking.rs
@@ -45,7 +45,7 @@ impl LobbyId {
impl <Manager> Matchmaking<Manager> {
pub fn request_lobby_list<F>(&self, cb: F)
- where F: Fn(SResult<Vec<LobbyId>>) + 'static + Send
+ where F: FnOnce(SResult<Vec<LobbyId>>) + 'static + Send
{
unsafe {
let api_call = sys::SteamAPI_ISteamMatchmaking_RequestLobbyList(self.mm);
@@ -77,7 +77,7 @@ impl <Manager> Matchmaking<Manager> {
/// * `LobbyEnter`
/// * `LobbyCreated`
pub fn create_lobby<F>(&self, ty: LobbyType, max_members: u32, cb: F)
- where F: Fn(SResult<LobbyId>) + 'static + Send
+ where F: FnOnce(SResult<LobbyId>) + 'static + Send
{
assert!(max_members <= 250); // Steam API limits
unsafe {
@@ -105,7 +105,7 @@ impl <Manager> Matchmaking<Manager> {
/// Tries to join the lobby with the given ID
pub fn join_lobby<F>(&self, lobby: LobbyId, cb: F)
- where F: Fn(Result<LobbyId, ()>) + 'static + Send
+ where F: FnOnce(Result<LobbyId, ()>) + 'static + Send
{
unsafe {
let api_call = sys::SteamAPI_ISteamMatchmaking_JoinLobby(self.mm, lobby.0);