use rustc_hash::FxHashMap;
use std::path::Path;
#[derive(Debug, Clone)]
pub enum EntryPoints {
Single(String),
Multiple(Vec<String>),
Named(FxHashMap<String, String>),
}
impl From<&str> for EntryPoints {
fn from(entry: &str) -> Self {
Self::Single(entry.to_string())
}
}
impl From<String> for EntryPoints {
fn from(entry: String) -> Self {
Self::Single(entry)
}
}
impl From<&Path> for EntryPoints {
fn from(entry: &Path) -> Self {
Self::Single(entry.to_string_lossy().into_owned())
}
}
impl<S: Into<String>> From<Vec<S>> for EntryPoints {
fn from(entries: Vec<S>) -> Self {
Self::Multiple(entries.into_iter().map(Into::into).collect())
}
}