From 852aa89e1e2466c8ead5f5d9f2321b8a53689c7f Mon Sep 17 00:00:00 2001 From: c4710n Date: Sat, 28 Sep 2024 10:26:52 +0800 Subject: [PATCH] Clarify the usage of custom type --- lib/nimble_options.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nimble_options.ex b/lib/nimble_options.ex index 397b6c1..1610219 100644 --- a/lib/nimble_options.ex +++ b/lib/nimble_options.ex @@ -158,9 +158,9 @@ 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])`. And, the return value should be `{: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