Skip to content

Commit

Permalink
Improve docs on function
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Sep 22, 2023
1 parent 9005e60 commit 17e9c56
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions minijinja/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ pub(crate) struct BoxedFunction(Arc<FuncFunc>, #[cfg(feature = "debug")] &'stati
///
/// For a list of built-in functions see [`functions`](crate::functions).
///
/// **Note:** this trait cannot be implemented and only exists drive the
/// functionality of [`add_function`](crate::Environment::add_function)
/// and [`from_function`](crate::value::Value::from_function). If you want
/// to implement a custom callable, you can directly implement
/// [`Object::call`](crate::value::Object::call) which is what the engine
/// actually uses internally.
///
/// # Basic Example
///
/// ```rust
Expand Down
2 changes: 1 addition & 1 deletion minijinja/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ pub mod machinery {

use crate::Output;

/// Returns a reference to a [`CompiledTemplate`] from a [`Template`].
/// Returns a reference to a [`CompiledTemplate`] from a [`Template`](crate::Template).
pub fn get_compiled_template<'x, 'env>(
tmpl: &'x crate::Template<'env, 'env>,
) -> &'x CompiledTemplate<'env> {
Expand Down
2 changes: 1 addition & 1 deletion minijinja/src/value/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl dyn Object {

/// Checks if the object is of a specific type.
///
/// For details of this operation see [`downcast_ref`](Self::downcast_ref).
/// For details of this operation see [`downcast_ref`](#method.downcast_ref).
pub fn is<T: 'static>(&self) -> bool {
let type_id = (*self).type_id();
type_id == TypeId::of::<T>()
Expand Down

0 comments on commit 17e9c56

Please sign in to comment.