From 035036ee4ebde31901e7ff92bee2e94496abb963 Mon Sep 17 00:00:00 2001 From: Tim Vilgot Mikael Fredenberg Date: Sun, 2 Jul 2023 07:39:17 +0200 Subject: [PATCH] refactor: reformat code with rustfmt 1.6.0 (#2233) Reformat code with rustfmt 1.6.0 that now supports let-else statements. --- twilight-gateway/src/json.rs | 16 ++++++++-------- twilight-mention/src/parse/iter.rs | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/twilight-gateway/src/json.rs b/twilight-gateway/src/json.rs index 47ba1881ba9..c90c878f992 100644 --- a/twilight-gateway/src/json.rs +++ b/twilight-gateway/src/json.rs @@ -64,14 +64,14 @@ pub fn parse( wanted_event_types: EventTypeFlags, ) -> Result, ReceiveMessageError> { let Some(gateway_deserializer) = GatewayEventDeserializer::from_json(&event) else { - return Err(ReceiveMessageError { - kind: ReceiveMessageErrorType::Deserializing { event }, - source: Some(Box::new(UnknownEventError { - event_type: None, - opcode: None, - })), - }); - }; + return Err(ReceiveMessageError { + kind: ReceiveMessageErrorType::Deserializing { event }, + source: Some(Box::new(UnknownEventError { + event_type: None, + opcode: None, + })), + }); + }; let Some(opcode) = OpCode::from(gateway_deserializer.op()) else { let opcode = gateway_deserializer.op(); diff --git a/twilight-mention/src/parse/iter.rs b/twilight-mention/src/parse/iter.rs index 6cf2a72af1b..3e9060865c1 100644 --- a/twilight-mention/src/parse/iter.rs +++ b/twilight-mention/src/parse/iter.rs @@ -63,7 +63,9 @@ impl<'a, T: ParseMention> Iterator for MentionIter<'a, T> { // chars here and not just individual bytes. We also want to not use // consuming methods of the iterator, so this will get a little weird. loop { - let (start, '<') = self.chars.next()? else { continue }; + let (start, '<') = self.chars.next()? else { + continue; + }; let mut found = false;