From cdeee17c2be5b8b9a333b977b3e2d373b94dfe0a Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Fri, 31 Jan 2025 02:32:19 -0600 Subject: do clippy stuff and change line endings --- src/auth/msa.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/auth/msa.rs') diff --git a/src/auth/msa.rs b/src/auth/msa.rs index 47e088b..404329b 100644 --- a/src/auth/msa.rs +++ b/src/auth/msa.rs @@ -112,8 +112,7 @@ impl XSTSAuthSuccessResponse { } fn get_display_claim(&self, name: &str) -> Option<&str> { - self.display_claims.xui.iter().filter(|m| m.contains_key(name)) - .next().map_or(None, |f| f.get(name).map(|s| s.as_str())) + self.display_claims.xui.iter().find(|m| m.contains_key(name)).and_then(|f| f.get(name).map(|s| s.as_str())) } pub(super) fn get_user_hash(&self) -> Option<&str> { @@ -121,8 +120,7 @@ impl XSTSAuthSuccessResponse { } pub(super) fn get_xuid(&self) -> Option { - self.get_display_claim("xid") - .map_or(None, |s| Some(Uuid::from_u64_pair(0, s.parse().ok()?))) + self.get_display_claim("xid").and_then(|s| s.parse().ok()).map(|n| Uuid::from_u64_pair(0, n)) } pub(super) fn get_gamertag(&self) -> Option<&str> { @@ -130,6 +128,7 @@ impl XSTSAuthSuccessResponse { } } +#[allow(clippy::from_over_into)] impl Into for XSTSAuthErrorResponse { fn into(self) -> AuthError { AuthError::AuthXError { -- cgit v1.2.3-70-g09d2