Add `InputFile::{file,url,file_id}` constructors
@@ -8,6 +8,24 @@ pub enum InputFile {
}
impl InputFile {
+ pub fn file(path: PathBuf) -> Self {
+ Self::File(path)
+ }
+
+ pub fn url<T>(url: T) -> Self
+ where
+ T: Into<String>
+ {
+ Self::Url(url.into())
+ }
+
+ pub fn file_id(file_id: T) -> Self
+ where
+ T: Into<String>
+ {
+ Self::FileId(fiel_id.into())
+ }
+
pub fn as_file(&self) -> Option<&PathBuf> {
match self {
Self::File(path) => Some(path),
