-
Notifications
You must be signed in to change notification settings - Fork 0
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
Grouped messages #209
Grouped messages #209
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a few opportunities where it's possible to return a little earlier.
applogic/src/api/messages.rs
Outdated
|
||
while let Some(conversation_message) = iter.next() { | ||
let mut timestamp = conversation_message.timestamp(); | ||
match conversation_message.message() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be a let Message::Content(content_message) = ... else { ... }
.
applogic/src/api/messages.rs
Outdated
// Keep collecting messages from the same sender | ||
while let Some(next_message) = iter.peek() { | ||
let temp_timestamp = next_message.timestamp(); | ||
match next_message.message() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be a let ... else
.
applogic/src/api/messages.rs
Outdated
let temp_timestamp = next_message.timestamp(); | ||
match next_message.message() { | ||
Message::Content(next_content_message) => { | ||
if next_content_message.sender() == current_sender { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If all we do is break
in the else branch, I'd prefer to check for the negative and break, before the function continues without opening a new code block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes! Let's get it merged.
No description provided.