diff --git a/src/file/mod.rs b/src/file/mod.rs index 72e0a361..02eda4bd 100644 --- a/src/file/mod.rs +++ b/src/file/mod.rs @@ -62,6 +62,15 @@ where source: FileSourceFile::new(name.into()), } } + + /// Identical to [`Self::new()`], but allows for using an owned [`PathBuf`]. + pub fn with_path(path: PathBuf, format: F) -> Self { + Self { + format: Some(format), + required: true, + source: FileSourceFile::new(path), + } + } } impl File {