Function handler_fn
Source pub fn handler_fn<Ctx, R, F>(f: F) -> HandlerFn<F>
Expand description
Wrap an infallible function as a Handler that always returns Some.
Use this when your mapping function cannot fail.
ยงExample
use tree_sitter_utils::{handler_fn, Handler, Input};
let h = handler_fn(|input: Input<()>| input.node.kind().to_owned());
let _ = h;