qo icon indicating copy to clipboard operation
qo copied to clipboard

Remove redundant else branch from HTTP_Matcher

Open bolshakov opened this issue 6 years ago • 1 comments

HTTP_Matcher = Qo.create_pattern_match(branches: [
  Qo.create_branch(name: 'success', precondition: Net::HTTPSuccess),
  Qo.create_branch(name: 'error', precondition: Net::HTTPError),
  Qo::Braches::ElseBranch
])

actually you don't have to include else branch to branches, since it's already included here https://github.com/baweaver/qo/blob/master/lib/qo/pattern_matchers/pattern_match.rb#L14

bolshakov avatar Feb 18 '19 11:02 bolshakov

True, yes, but in a way this makes it more explicit what branches it accepts. I may have to rethink the underlying code a bit.

baweaver avatar Feb 19 '19 00:02 baweaver