Skip to content

Commit 46d914c

Browse files
authored
docs: Add spec for within (#265)
1 parent 6064b8b commit 46d914c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/igniter/code/common.ex

+3-1
Original file line numberDiff line numberDiff line change
@@ -1195,8 +1195,10 @@ defmodule Igniter.Code.Common do
11951195
Runs the function `fun` on the subtree of the currently focused `node` and
11961196
returns the updated `zipper`.
11971197
1198-
`fun` must return {:ok, zipper} or `:error`, which may be positioned at the top of the subtree.
1198+
`fun` must return `{:ok, zipper}` or `:error`, which may be positioned at the top of the subtree.
11991199
"""
1200+
@spec within(Zipper.t(), (Zipper.t() -> {:ok, Zipper.t()} | :error)) ::
1201+
{:ok, Zipper.t()} | :error
12001202
def within(%Zipper{} = top_zipper, fun) when is_function(fun, 1) do
12011203
top_zipper
12021204
|> Zipper.subtree()

0 commit comments

Comments
 (0)