Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FileSourceFile, FileFormat> {
Expand Down
Loading