Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: reformat code with rustfmt 1.6.0 #2233

Merged
merged 1 commit into from
Jul 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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