diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f23760f..24a2b74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,18 +13,21 @@ jobs: strategy: matrix: - otp: [21, 22, 23, 24] + otp: [25, 26] rust: [stable] - container: - image: erlang:${{matrix.otp}} - steps: - name: Checkout sources - uses: actions/checkout@v1 + uses: actions/checkout@v4 + + - name: Install Erlang OTP + uses: erlef/setup-beam@v1 + with: + otp-version: ${{matrix.otp}} + rebar3-version: 3.22.1 - name: Install Rust ${{matrix.rust}} toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: ${{matrix.rust}} override: true diff --git a/rebar.config b/rebar.config index a13ec97..9176668 100644 --- a/rebar.config +++ b/rebar.config @@ -1,7 +1,7 @@ {erl_opts, [debug_info]}. {profiles, [ - {test, [{deps, [{xxh3, "0.3.2"}]}]} + {test, [{deps, [{xxh3, "0.3.5"}]}]} ]}. {project_plugins, [erlfmt]}. diff --git a/src/cuckoo_filter.erl b/src/cuckoo_filter.erl index 8bcf9ca..440fddd 100644 --- a/src/cuckoo_filter.erl +++ b/src/cuckoo_filter.erl @@ -353,6 +353,8 @@ import(FilterName, Data) -> %% Internal functions %%%------------------------------------------------------------------- +-dialyzer({nowarn_function, default_hash_function/1}). + default_hash_function(Size) when Size > 64 -> fun(Element) -> xxh3:hash128(term_to_binary(Element)) end; default_hash_function(Size) when Size > 32 -> diff --git a/src/cuckoo_filter.hrl b/src/cuckoo_filter.hrl index 89e2517..69c885c 100644 --- a/src/cuckoo_filter.hrl +++ b/src/cuckoo_filter.hrl @@ -5,5 +5,5 @@ bucket_size :: pos_integer(), fingerprint_size :: 4 | 8 | 16 | 32 | 64, max_evictions :: non_neg_integer(), - hash_function :: fun((binary()) -> non_neg_integer()) + hash_function :: fun((any()) -> non_neg_integer()) }).