mod iter;
mod reflection;
pub use iter::Iter;
pub use reflection::Reflection;
pub use Reflection as LinkPathListReflection;
use std::path::PathBuf;
#[derive(Debug, Clone)]
pub struct LinkPathList(Vec<PathBuf>);
impl LinkPathList {
#[cfg(any(unix, test))]
#[inline]
pub(crate) fn single(path: PathBuf) -> Self {
LinkPathList(vec![path])
}
#[cfg(test)]
pub(crate) fn many(paths: impl IntoIterator<Item: Into<PathBuf>>) -> Self {
let paths: Vec<_> = paths.into_iter().map(Into::into).collect();
assert!(!paths.is_empty(), "paths must not be empty");
LinkPathList(paths)
}
#[cfg(any(unix, test))]
#[inline]
pub(crate) fn add(&mut self, path: PathBuf) {
self.0.push(path)
}
#[inline]
pub fn len(&self) -> usize {
self.0.len()
}
#[inline]
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
#[inline]
pub fn into_reflection(self) -> Reflection {
self.into()
}
}
#[cfg(test)]
mod test;