use super::{DeduplicateSharedSize, RecordHardlinks, RecordHardlinksArgument};
use crate::{data_tree::DataTree, os_string_display::OsStringDisplay, size};
use std::convert::Infallible;
#[derive(Debug, Default, Clone, Copy)]
pub struct Ignorant;
pub use Ignorant as HardlinkIgnorant;
impl<Size, Reporter> RecordHardlinks<Size, Reporter> for Ignorant {
type Error = Infallible;
#[inline]
fn record_hardlinks(
&self,
_: RecordHardlinksArgument<Size, Reporter>,
) -> Result<(), Self::Error> {
Ok(())
}
}
impl<Size> DeduplicateSharedSize<Size> for HardlinkIgnorant
where
Size: size::Size + Sync,
{
type Report = ();
type Error = Infallible;
#[inline]
fn deduplicate(
self,
_: &mut DataTree<OsStringDisplay, Size>,
) -> Result<Self::Report, Self::Error> {
Ok(())
}
}