mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
[Crate] Enforce formatting in CI (#46)
* [CI] Check formatting * Format all files
This commit is contained in:
parent
a6279177bb
commit
b95b2abe0f
76 changed files with 251 additions and 170 deletions
|
|
@ -71,7 +71,12 @@ impl ValveMasterServer {
|
|||
|
||||
let mut ips: Vec<(IpAddr, u16)> = Vec::new();
|
||||
while buf.remaining_length() > 0 {
|
||||
let ip = IpAddr::V4(Ipv4Addr::new(buf.get_u8()?, buf.get_u8()?, buf.get_u8()?, buf.get_u8()?));
|
||||
let ip = IpAddr::V4(Ipv4Addr::new(
|
||||
buf.get_u8()?,
|
||||
buf.get_u8()?,
|
||||
buf.get_u8()?,
|
||||
buf.get_u8()?,
|
||||
));
|
||||
let port = buf.get_u16()?;
|
||||
|
||||
ips.push((ip, port));
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ pub enum Filter {
|
|||
HasTags(Vec<String>),
|
||||
MatchName(String),
|
||||
MatchVersion(String),
|
||||
/// Restrict to only a server if an IP hosts (on different ports) multiple servers.
|
||||
/// Restrict to only a server if an IP hosts (on different ports) multiple
|
||||
/// servers.
|
||||
RestrictUniqueIP(bool),
|
||||
/// Query for servers on a specific address.
|
||||
OnAddress(String),
|
||||
|
|
@ -133,7 +134,8 @@ impl Filter {
|
|||
/// .insert(Filter::IsEmpty(false))
|
||||
/// .insert(Filter::CanHavePassword(false));
|
||||
/// ```
|
||||
/// This will construct filters that search for servers that can't have a password, are not empty and run App ID 440.
|
||||
/// This will construct filters that search for servers that can't have a
|
||||
/// password, are not empty and run App ID 440.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct SearchFilters {
|
||||
filters: HashMap<Discriminant<Filter>, Filter>,
|
||||
|
|
@ -208,8 +210,14 @@ impl SearchFilters {
|
|||
bytes.extend(filter.to_bytes())
|
||||
}
|
||||
|
||||
bytes.extend(SearchFilters::special_filter_to_bytes("nand", &self.nand_filters));
|
||||
bytes.extend(SearchFilters::special_filter_to_bytes("nor", &self.nor_filters));
|
||||
bytes.extend(SearchFilters::special_filter_to_bytes(
|
||||
"nand",
|
||||
&self.nand_filters,
|
||||
));
|
||||
bytes.extend(SearchFilters::special_filter_to_bytes(
|
||||
"nor",
|
||||
&self.nor_filters,
|
||||
));
|
||||
|
||||
bytes.extend([0x00]);
|
||||
bytes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue