-
Notifications
You must be signed in to change notification settings - Fork 346
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
next/prev: refactor movement utilities into cli/src/movement_utils.rs #4282
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.
nit: I think "no-op" and "Refactor" is redundant. Refactoring always has (or should have) no visible effect on the behavior. So e.g. "next/prev: refactor ..." would be slightly clearer to me, and "This no-op PR" sounds better as "This refactoring commit/patch" sounds better to me (it's clearer about the sense in which it's a no-op).
da56062
to
4b6b93c
Compare
I had a similar approach here: PhilipMetzger@9c37e18, although I renamed the directions to just |
Makes sense. Reworded. |
8ab778f
to
67a730c
Compare
4b6b93c
to
50395e7
Compare
e7ccd6a
to
e34ebe1
Compare
The code in both cli/src/commands/{next,prev}.rs is identical except for the direction of movement. This commit pull the parts that make sense out into cli/src/movement_util.rs so it's easier to see the differences. Part of #3947
e34ebe1
to
32c715f
Compare
* Derive a bunch of standard and useful traits for `movement_util::Direction` as it is a simple type. Importantly `Copy`. * Return `&'static str` from Direction.cmd() * Refactor out `MovementArgs` to reduce the number of arguments to `movement_util::move_to_commit`. * Implement `From<&NextArgs/&PrevArgs>` for MovementArgs Part of #3947
* Derive a bunch of standard and useful traits for `movement_util::Direction` as it is a simple type. Importantly `Copy`. * Return `&'static str` from Direction.cmd() * Refactor out `MovementArgs` to reduce the number of arguments to `movement_util::move_to_commit`. * Implement `From<&NextArgs/&PrevArgs>` for MovementArgs Part of #3947
* Derive a bunch of standard and useful traits for `movement_util::Direction` as it is a simple type. Importantly `Copy`. * Return `&'static str` from Direction.cmd() * Refactor out `MovementArgs` to reduce the number of arguments to `movement_util::move_to_commit`. * Implement `From<&NextArgs/&PrevArgs>` for MovementArgs Part of #3947
* Derive a bunch of standard and useful traits for `movement_util::Direction` as it is a simple type. Importantly `Copy`. * Return `&'static str` from Direction.cmd() * Refactor out `MovementArgs` to reduce the number of arguments to `movement_util::move_to_commit`. * Implement `From<&NextArgs/&PrevArgs>` for MovementArgs Part of #3947
* Derive a bunch of standard and useful traits for `movement_util::Direction` as it is a simple type. Importantly `Copy`. * Return `&'static str` from Direction.cmd() * Refactor out `MovementArgs` to reduce the number of arguments to `movement_util::move_to_commit`. * Implement `From<&NextArgs/&PrevArgs>` for MovementArgs Part of #3947
The code in both cli/src/commands/{next,prev}.rs is identical except for the direction of movement. This PR pull the parts that make sense out into cli/src/movement_util.rs so it's easier to see the differences. No new behavious is introduced.
Part of #3947
Checklist
If applicable:
CHANGELOG.md