diff options
author | Andrea Leopardi <an.leopardi@gmail.com> | 2023-05-16 17:56:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 17:56:47 +0200 |
commit | afd4de8ff3a72fa792fc0ef994bfe1da8465652f (patch) | |
tree | e43c5b9db8c996001f47671afd1e28efb4d12e0d | |
parent | e9f305c56b72191a023022412b6689c9131d049a (diff) | |
download | elixir-afd4de8ff3a72fa792fc0ef994bfe1da8465652f.tar.gz |
Improve specs for profiling-relates functions (#12563)
-rw-r--r-- | lib/mix/lib/mix/tasks/profile.cprof.ex | 2 | ||||
-rw-r--r-- | lib/mix/lib/mix/tasks/profile.eprof.ex | 2 | ||||
-rw-r--r-- | lib/mix/lib/mix/tasks/profile.fprof.ex | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/mix/lib/mix/tasks/profile.cprof.ex b/lib/mix/lib/mix/tasks/profile.cprof.ex index c538353e5..0e811565d 100644 --- a/lib/mix/lib/mix/tasks/profile.cprof.ex +++ b/lib/mix/lib/mix/tasks/profile.cprof.ex @@ -168,7 +168,7 @@ defmodule Mix.Tasks.Profile.Cprof do * `:module` - filters out any results not pertaining to the given module """ - @spec profile((-> any()), keyword()) :: any() + @spec profile((-> result), keyword()) :: result when result: any() def profile(fun, opts \\ []) when is_function(fun, 0) do Mix.ensure_application!(:tools) {return_value, num_matched_functions, analysis_result} = profile_and_analyse(fun, opts) diff --git a/lib/mix/lib/mix/tasks/profile.eprof.ex b/lib/mix/lib/mix/tasks/profile.eprof.ex index 3e4532f09..36cc25984 100644 --- a/lib/mix/lib/mix/tasks/profile.eprof.ex +++ b/lib/mix/lib/mix/tasks/profile.eprof.ex @@ -183,7 +183,7 @@ defmodule Mix.Tasks.Profile.Eprof do * `:sort` - sort the results by `:time` or `:calls` (default: `:time`) """ - @spec profile((-> any()), keyword()) :: any() + @spec profile((-> result), keyword()) :: result when result: any() def profile(fun, opts \\ []) when is_function(fun, 0) do Mix.ensure_application!(:tools) {return_value, results} = profile_and_analyse(fun, opts) diff --git a/lib/mix/lib/mix/tasks/profile.fprof.ex b/lib/mix/lib/mix/tasks/profile.fprof.ex index 7dbc80b8e..f2431bdc4 100644 --- a/lib/mix/lib/mix/tasks/profile.fprof.ex +++ b/lib/mix/lib/mix/tasks/profile.fprof.ex @@ -180,7 +180,7 @@ defmodule Mix.Tasks.Profile.Fprof do usage for larger workloads. """ - @spec profile((-> any()), keyword()) :: any() + @spec profile((-> result), keyword()) :: result when result: any() def profile(fun, opts \\ []) when is_function(fun, 0) do Mix.ensure_application!(:runtime_tools) Mix.ensure_application!(:tools) |