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

[2/5] [4] cluster: change order of codes #709

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

0xWOF
Copy link
Contributor

@0xWOF 0xWOF commented Nov 4, 2022

Changes

  • cluster: move ClusterConnection struct declaration to above of impl
  • cluster: move set_auto_reconnect

Effect

  • cluster:
    • no public api is changed
    • code is changed but behavior will not be changed

Note

@0xWOF 0xWOF force-pushed the cluster_client_refactor_2_4 branch 2 times, most recently from 6786bf8 to 45f31cd Compare November 8, 2022 12:53
@0xWOF
Copy link
Contributor Author

0xWOF commented Nov 8, 2022

I rebase it because of PR 3 is merged. After this PR, I'll create PR one by one.

redis/src/cluster.rs Show resolved Hide resolved
redis/src/cluster.rs Outdated Show resolved Hide resolved
@0xWOF 0xWOF requested a review from djc November 8, 2022 14:44
@0xWOF 0xWOF force-pushed the cluster_client_refactor_2_4 branch 2 times, most recently from d862167 to ac05805 Compare November 8, 2022 15:22
@0xWOF
Copy link
Contributor Author

0xWOF commented Nov 8, 2022

ci problem is same with previous intermittent one. #704 (comment)

@0xWOF 0xWOF force-pushed the cluster_client_refactor_2_4 branch from ac05805 to fb2118a Compare November 8, 2022 16:29
@utkarshgupta137
Copy link
Contributor

utkarshgupta137 commented Nov 8, 2022

IMO, it is better to define everything before it is used in the code, to the extent possible. The purpose of the original commit was to bring the struct & impls of ClusterConnection next to each other. You're of course, free to follow your convention.

@utkarshgupta137
Copy link
Contributor

utkarshgupta137 commented Nov 8, 2022

Not to mention that the more changes you make early on, the harder it will be to apply future changes. There are a lot of changes in this file, so it would probably be best not to mess with the order of code if it doesn't make a lot of difference. I apologise for moving a lot of code in the first place.

@0xWOF
Copy link
Contributor Author

0xWOF commented Nov 8, 2022

@utkarshgupta137 I think some changes are can't be avoidable and rebase difficulty is still bearable. So I'll be careful more not to do mis-rebase for now. But your concern is reasonable too. I'll find other better way to satisfy ease-of-rebase and code-change-ability when I can't bearable more.

…ype, struct, enum, fn

cluster: move main struct to above of main impl

move methods in order: constructor, pub fn, pub(crate) fn, fn
@0xWOF 0xWOF force-pushed the cluster_client_refactor_2_4 branch from fb2118a to 8001465 Compare November 8, 2022 17:05
@djc djc merged commit d6e826a into redis-rs:main Nov 8, 2022
@0xWOF 0xWOF deleted the cluster_client_refactor_2_4 branch November 9, 2022 13:59
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.

None yet

3 participants