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

Tiny plan to fix issue 50 #51

Merged
merged 2 commits into from
Jan 7, 2019
Merged

Tiny plan to fix issue 50 #51

merged 2 commits into from
Jan 7, 2019

Conversation

yuezato
Copy link
Member

@yuezato yuezato commented Dec 17, 2018

Please see: #50

while let Async::Ready(polled) = track!(self.rlog.poll())? {
if let Some(event) = polled {
track!(self.handle_raft_event(event))?;
match event {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the code can be rewritten a bit more concise as follows:

if let raftlog::Event::SnapshotLoaded { .. } = event {
    track!(self.handle_raft_event(event))?;
    break;
} else {
    track!(self.handle_raft_event(event))?;
}

match event {
raftlog::Event::SnapshotLoaded { .. } => {
track!(self.handle_raft_event(event))?;
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment about why this break is required?

Copy link
Contributor

@shinnya shinnya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@sile sile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@yuezato yuezato merged commit c5eb7de into master Jan 7, 2019
@yuezato yuezato deleted the issue50 branch February 8, 2019 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants