Skip to main content

templates

Function templates 

Source
pub fn templates() -> Option<PathBuf>
Expand description

Returns the user’s templates directory.

Checks XDG_TEMPLATES_DIR first, then falls back to platform defaults:

  • Linux/macOS: ~/Templates
  • Windows: %USERPROFILE%\Templates

§Examples

use dir_spec::templates;
if let Some(templates) = templates() {
    println!("Templates directory: {}", templates.display());
}