Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove ChannelEnd::order_matches() #394

Closed
plafer opened this issue Feb 1, 2023 · 2 comments · Fixed by #1095
Closed

Remove ChannelEnd::order_matches() #394

plafer opened this issue Feb 1, 2023 · 2 comments · Fixed by #1095
Labels
A: good-first-issue Admin: good for newcomers A: low-priority Admin: low priority / non urgent issue, expect longer wait time for PR reviews O: maintainability Objective: cause to ease modification, fault corrections and improve code understanding
Milestone

Comments

@plafer
Copy link
Contributor

plafer commented Feb 1, 2023

We should use a match statement instead. This pattern encourages not looking at all possible variants, and shouldn't be used.

At the same time, we should understand what the Order::None represents, and if we keep it, what to do in cases where the order is None.

@plafer plafer added O: maintainability Objective: cause to ease modification, fault corrections and improve code understanding A: low-priority Admin: low priority / non urgent issue, expect longer wait time for PR reviews A: good-first-issue Admin: good for newcomers labels Feb 1, 2023
@Farhad-Shabani Farhad-Shabani moved this to 📥 To Do in ibc-rs Feb 2, 2023
@DaviRain-Su
Copy link
Contributor

I think is ok, maybe can implement to seem this.

  pub fn order_matches(&self, other: &Order) -> bool {
        // self.ordering.eq(other)
        match (self.ordering, other) {
            (Order::None, Order::None) => true,
            (Order::Unordered, Order::Unordered) => true,
            (Order::Ordered, Order::Ordered) => true,
            _ => false,
        }
   }

@DaviRain-Su
Copy link
Contributor

截屏2023-06-01 17 20 56

Just search order_matches(), for now, pass param values is Order. We don't used any field.

@github-project-automation github-project-automation bot moved this from 📥 To Do to ✅ Done in ibc-rs Feb 21, 2024
@Farhad-Shabani Farhad-Shabani added this to the 0.51.0 milestone Feb 21, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A: good-first-issue Admin: good for newcomers A: low-priority Admin: low priority / non urgent issue, expect longer wait time for PR reviews O: maintainability Objective: cause to ease modification, fault corrections and improve code understanding
Projects
None yet
3 participants