use std::path::PathBuf;
#[derive(Debug, Clone)]
pub enum ParseInput {
Path(PathBuf),
Bytes(Vec<u8>),
}
impl From<PathBuf> for ParseInput {
fn from(p: PathBuf) -> Self {
ParseInput::Path(p)
}
}
impl From<&std::path::Path> for ParseInput {
fn from(p: &std::path::Path) -> Self {
ParseInput::Path(p.to_path_buf())
}
}
impl From<String> for ParseInput {
fn from(s: String) -> Self {
ParseInput::Path(PathBuf::from(s))
}
}
impl From<&str> for ParseInput {
fn from(s: &str) -> Self {
ParseInput::Path(PathBuf::from(s))
}
}
impl From<Vec<u8>> for ParseInput {
fn from(b: Vec<u8>) -> Self {
ParseInput::Bytes(b)
}
}