Skip to content

Commit cf294c3

Browse files
committed
First couple of 1.19 fixes
1 parent 6a0ba8a commit cf294c3

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

lib/benchee/benchmark/runner.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ defmodule Benchee.Benchmark.Runner do
302302
Enum.reverse(measurements)
303303
end
304304

305-
defp do_benchmark(scenario, scenario_context, collector, measurements) do
305+
defp do_benchmark(scenario, %ScenarioContext{} = scenario_context, collector, measurements) do
306306
measurement = collect(scenario, scenario_context, collector)
307307

308308
updated_context = %ScenarioContext{

lib/benchee/formatter.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ defmodule Benchee.Formatter do
197197
update_in(suite.configuration, &scrub_configuration/1)
198198
end
199199

200-
defp scrub_scenario(scenario) do
200+
defp scrub_scenario(%Scenario{} = scenario) do
201201
%Scenario{scenario | function: nil, input: nil}
202202
end
203203

lib/benchee/scenario_loader.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ defmodule Benchee.ScenarioLoader do
1515
Load the file(s) specified as `load_path` and add the scenarios to the list of the
1616
current scenarios in the suite.
1717
"""
18-
def load(suite = %{configuration: %{load: load_path}, scenarios: scenarios}) do
18+
def load(suite = %Suite{configuration: %{load: load_path}, scenarios: scenarios}) do
1919
loaded = load_scenarios(load_path)
2020
%Suite{suite | scenarios: scenarios ++ loaded}
2121
end

test/benchee_test.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ defmodule BencheeTest do
767767
defp without_functions_and_inputs(suite) do
768768
update_in(suite.scenarios, fn scenarios ->
769769
Enum.map(scenarios, fn scenario ->
770+
%Benchee.Scenario{} = scenario
770771
%Benchee.Scenario{scenario | function: nil, input: nil}
771772
end)
772773
end)

0 commit comments

Comments
 (0)