pub async fn hash_file<T>(&mut self, path: T) -> Result<bool>
	where
		T: AsRef<Path>,
	{
		let path = path.as_ref();
		let digest = self.entry(path.to_owned()).or_insert(None);
		let prev_digest = *digest;
		let mut hasher = Sha1::default();
		let content = read(path).await?;
		hasher.update(&content);
		*digest = Some(hasher.digest());
		Ok(prev_digest != *digest)
	}
/// add file digest identifies by path in the hashmap and return true if the value is new or has changed
add file digest identifies by path in the hashmap and return true if the value is new or has changed
add file digest identifies by path in the hashmap and return true if the value is new or has changed
pub async fn hash_file<T>(&mut self, path: T) -> Result<bool>
	where
		T: AsRef<Path>,
	{
		let path = path.as_ref();
		let digest = self.entry(path.to_owned()).or_insert(None);
		let prev_digest = *digest;
		let mut hasher = Sha1::default();
		let content = read(path).await?;
		hasher.update(&content);
		*digest = Some(hasher.digest());
		Ok(prev_digest != *digest)
	}
pub async fn hash_file < T > ( & mut self , path : T ) -> Result < bool > where T : AsRef < Path > , { let path = path . as_ref ( ) ; let digest = self . entry ( path . to_owned ( ) ) . or_insert ( None ) ; let prev_digest = * digest ; let mut hasher = Sha1 :: default ( ) ; let content = read ( path ) . await ? ; hasher . update ( & content ) ; * digest = Some ( hasher . digest ( ) ) ; Ok ( prev_digest != * digest ) }
add file digest identifies by path in the hashmap and return true if the value is new or has changed
add file digest identifies by path in the hashmap and return true if the value is new or has changed
&mut self
path
T
&mut self
path
T