/// Prefix the target path with a hash value to support TUF spec 5.5.2.
Prefix the target path with a hash value to support TUF spec 5.5.2.
Prefix the target path with a hash value to support TUF spec 5 . 5 . 2 .
pub fn with_hash_prefix(&self, hash: &HashValue) -> Result<TargetPath> {
        let mut components = self.components();
        // The unwrap here is safe because we checked in `safe_path` that the path is not empty.
        let file_name = components.pop().unwrap();
        components.push(format!("{}.{}", hash, file_name));
        TargetPath::new(components.join("/"))
    }
pub fn with_hash_prefix ( & self , hash : & HashValue ) -> Result < TargetPath > { let mut components = self . components ( ) ; // The unwrap here is safe because we checked in `safe_path` that the path is not empty. let file_name = components . pop ( ) . unwrap ( ) ; components . push ( format ! ( " " hash file_name ) ) ; TargetPath :: new ( components . join ( " " ) ) }
Prefix the target path with a hash value to support TUF spec 5.5.2.
Prefix the target path with a hash value to support TUF spec 5 . 5 . 2 .
&self
hash
&HashValue