Skip to content

Docstring inconsistency in function register_templates_directory #705

@vsbits

Description

@vsbits

Docstring references parameters tpl_extension and dir_path, while function declaration references dir_path and options.

Looks like #601 introduced the change, but these two doc lines were overlooked.

/// Register templates from a directory
///
/// * `tpl_extension`: the template file extension
/// * `dir_path`: the path of directory
///
/// Hidden files and tempfile (starts with `#`) will be ignored by default.
/// Set `DirectorySourceOptions` to something other than `DirectorySourceOptions::default()` to adjust this.
/// All registered templates will use their relative path to determine their template name.
/// For example, when `dir_path` is `templates/` and `DirectorySourceOptions.tpl_extension` is `.hbs`, the file
/// `templates/some/path/file.hbs` will be registered as `some/path/file`.
///
/// This method is not available by default.
/// You will need to enable the `dir_source` feature to use it.
///
/// When dev_mode is enabled, like with `register_template_file`, templates are reloaded
/// from the file system every time they're visited.
#[cfg(feature = "dir_source")]
#[cfg_attr(docsrs, doc(cfg(feature = "dir_source")))]
pub fn register_templates_directory<P>(
&mut self,
dir_path: P,
options: DirectorySourceOptions,
) -> Result<(), TemplateError>

Other functions in the file don't seem to have this type of annotation. Should I send a PR just deleting these lines to avoid confusion?

/// * `tpl_extension`: the template file extension
/// * `dir_path`: the path of directory
///

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions