def is_needless
bend-lint-rules@0.2.0.0 · language/unneeded_plus.bend:110
import bend-lint-rules@0.2.0.0/language/unneeded_plus.bend as UnneededPlus
import Base
110
111
112def is_needless(once: Bool, parameter: Bool, owner: Owner, b: U32) -> Bool:
113 match once parameter owner:
114 case True{} True{} Owner{values, target, matched}:
115 Bool.not(
116 List.contains(~String, ~String.eq, values, target)
117 )
118 && Bool.not(List.contains(~U32, ~U32.is_eq, matched, b))
119 case True{} False{} Owner{values, target, matched}:
120 Bool.not(List.contains(~U32, ~U32.is_eq, matched, b))
121 case _ _ _:
122 False{}