Page MenuHomePhabricator

rust-chg: indent process_message() to prepare mass rewrite to futures-0.3
ClosedPublic

Authored by yuja on Apr 11 2020, 7:24 AM.

Details

Summary

I'll start upgrading the codebase to modern async/await-based implementation,
which cannot be done incrementally. This is the last non-breaking patch to
prepare for the rewrite.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

yuja created this revision.Apr 11 2020, 7:24 AM
Alphare accepted this revision.Apr 14 2020, 5:11 AM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
rust/chg/src/runcommand.rs
143–167

Not sure I understand the extra bracket here.

yuja added a comment.Apr 14 2020, 8:09 AM

+ {
+ match msg {

Not sure I understand the extra bracket here.

It's just for rustfmt to indent one more depth.

Because you expect to add an async block or something that will make the diff harder to read, I suppose?

yuja added a comment.Apr 14 2020, 10:17 AM
Because you expect to add an async block or something that will make the diff harder to read, I suppose?

The match will be surrounded by a simple loop {}, which was previously
a state machine. And yes, reading the subsequent 10 patches would be painful
without indent-level adjustment.

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.