Skip to content

Commit

Permalink
Added a note on what add_function does
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Jan 7, 2025
1 parent 02622b7 commit 856903b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions minijinja/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,9 @@ impl<'source> Environment<'source> {
/// functions and other global variables share the same namespace.
/// For more details about functions have a look at
/// [`Function`](crate::functions::Function).
///
/// This is a shortcut for calling [`add_global`](Self::add_global) with the
/// function wrapped with [`Value::from_function`].
pub fn add_function<N, F, Rv, Args>(&mut self, name: N, f: F)
where
N: Into<Cow<'source, str>>,
Expand Down

0 comments on commit 856903b

Please sign in to comment.