mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-06 15:27:28 +00:00
Change valve get_server_rules to not return an Option
This commit is contained in:
parent
a37e2506b4
commit
ef8ac92506
1 changed files with 4 additions and 4 deletions
|
|
@ -383,8 +383,8 @@ impl ValveProtocol {
|
|||
Ok(players)
|
||||
}
|
||||
|
||||
/// Get the server rules's.
|
||||
fn get_server_rules(&mut self, app: &App, protocol: u8) -> GDResult<Option<Vec<ServerRule>>> {
|
||||
/// Get the server's rules.
|
||||
fn get_server_rules(&mut self, app: &App, protocol: u8) -> GDResult<Vec<ServerRule>> {
|
||||
let mut buffer = self.get_request_data(&app, protocol, Request::RULES)?;
|
||||
|
||||
let count = buffer.get_u16()? as usize;
|
||||
|
|
@ -397,7 +397,7 @@ impl ValveProtocol {
|
|||
})
|
||||
}
|
||||
|
||||
Ok(Some(rules))
|
||||
Ok(rules)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -430,7 +430,7 @@ fn get_response(address: &str, port: u16, app: App, gather_settings: GatheringSe
|
|||
},
|
||||
rules: match gather_settings.rules {
|
||||
false => None,
|
||||
true => client.get_server_rules(&app, protocol)?
|
||||
true => Some(client.get_server_rules(&app, protocol)?)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue