Skip to content

Commit

Permalink
Clarify the usage of custom type
Browse files Browse the repository at this point in the history
  • Loading branch information
c4710n committed Oct 5, 2024
1 parent 1d269dc commit 5c3e523
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/nimble_options.ex
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ defmodule NimbleOptions do
called `:one_of` and the `:in` name is available since version 0.3.3 (`:one_of`
has been removed in v0.4.0).
* `{:custom, mod, fun, args}` - A custom type. The related value must be validated
by `mod.fun(values, ...args)`. The function should return `{:ok, value}` or
`{:error, message}`.
* `{:custom, mod, fun, args}` - A custom type. The related value will be validated
by `apply(mod, fun, [value | args])`. `fun` should return `{:ok, value}` or `{:error, message}`.
* `{:or, subtypes}` - A value that matches one of the given `subtypes`. The value is
matched against the subtypes in the order specified in the list of `subtypes`. If
Expand Down

0 comments on commit 5c3e523

Please sign in to comment.