dashbitco / nimble_options

A tiny library for validating and documenting high-level options. 💽
Apache License 2.0
507 stars 38 forks source link

Switch function names #27

Closed milmazz closed 4 years ago

milmazz commented 4 years ago

The first time that I read this code:

  def validate(options, schema) do
    case validate_options_with_schema_and_path(schema, options_schema()) do

and this one:

  defp validate_options_with_schema(opts, fun, path) when is_function(fun) do
    validate_options_with_schema(opts, fun.(), path)

it confused me a bit, on the first validate_options_with_schema_and_path/2 I don't see the path as an argument, in the second block of code, I see that the path is needed but the function name is validate_options_with_schema. So, my best guess is that we should switch the function names and that's what I did here.

whatyouhide commented 4 years ago

Good call, thanks @milmazz :)