From d132e2bcb4aa48930897026ff3d7506b09a62318 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 3 May 2021 14:35:00 +0100 Subject: Update src/lib.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aaro Perämaa --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) } } -- cgit v1.2.3