Skip to content

Commit

Permalink
Merge branch 'main' into vilgotf/gateway/ratelimiter-reset-hack
Browse files Browse the repository at this point in the history
  • Loading branch information
vilgotf committed Jul 2, 2023
2 parents 93bf33c + 035036e commit b228229
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 8 additions & 8 deletions twilight-gateway/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ pub fn parse(
wanted_event_types: EventTypeFlags,
) -> Result<Option<GatewayEvent>, 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();
Expand Down
4 changes: 3 additions & 1 deletion twilight-mention/src/parse/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit b228229

Please sign in to comment.