aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorWilliam <[email protected]>2021-05-03 14:35:00 +0100
committerGitHub <[email protected]>2021-05-03 14:35:00 +0100
commitd132e2bcb4aa48930897026ff3d7506b09a62318 (patch)
tree01277a45b57ea7dea4d737b31e74157c62376f6d /src/lib.rs
parentAdd SteamID utils (AccountId::from_raw, AccountId::raw) and SteamId::steamid32 (diff)
downloadsteamworks-rs-d132e2bcb4aa48930897026ff3d7506b09a62318.tar.xz
steamworks-rs-d132e2bcb4aa48930897026ff3d7506b09a62318.zip
Update src/lib.rs
Co-authored-by: Aaro Perämaa <[email protected]>
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 5555e70..f9a5251 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -374,7 +374,7 @@ impl SteamId {
/// Returns the formatted SteamID32 string for this steam id.
pub fn steamid32(&self) -> String {
let account_id = self.account_id().raw();
- let last_bit: u8 = if account_id % 2 == 0 { 0 } else { 1 };
+ let last_bit = account_id & 1;
format!("STEAM_0:{}:{}", last_bit, (account_id >> 1))
}
}