Skip to content

Fix Brex.none/1 behaviour for empty lists

Compare
Choose a tag to compare
@sascha-wolf sascha-wolf released this 21 Nov 11:43

The behaviour of Brex.none/1 was confusing for an empty list of rules, due to simply inverting the result of Brex.all/1. This release introduces a special handling for an empty list of rules:

Before

iex> rules |> Brex.none() |> Brex.satisfies?(:whatever)
false

After

iex> rules |> Brex.none() |> Brex.satisfies?(:whatever)
true