fn write_blob(dir: &openat::Dir, subdir: impl AsRef<Path>, mut payload: impl Read) -> String {
        let mut buf = vec![];
        payload.read_to_end(&mut buf).unwrap();
        let merkle =
            fuchsia_merkle::MerkleTree::from_reader(buf.as_slice()).unwrap().root().to_string();

        let mut f = dir.new_file(&subdir.as_ref().join(&merkle), 0600).unwrap();
        f.set_len(buf.len() as u64).unwrap();
        f.write_all(&buf).unwrap();

        merkle
    }
/// Writes a blob in the given directory and path, returning the computed merkle root of the blob.
Writes a blob in the given directory and path, returning the computed merkle root of the blob.
Writes a blob in the given directory and path returning the computed merkle root of the blob .
fn write_blob(dir: &openat::Dir, subdir: impl AsRef<Path>, mut payload: impl Read) -> String {
        let mut buf = vec![];
        payload.read_to_end(&mut buf).unwrap();
        let merkle =
            fuchsia_merkle::MerkleTree::from_reader(buf.as_slice()).unwrap().root().to_string();
        let mut f = dir.new_file(&subdir.as_ref().join(&merkle), 0600).unwrap();
        f.set_len(buf.len() as u64).unwrap();
        f.write_all(&buf).unwrap();
        merkle
    }
fn write_blob ( dir : & openat :: Dir , subdir : impl AsRef < Path > , mut payload : impl Read ) -> String { let mut buf = vec ! [ ] ; payload . read_to_end ( & mut buf ) . unwrap ( ) ; let merkle = fuchsia_merkle :: MerkleTree :: from_reader ( buf . as_slice ( ) ) . unwrap ( ) . root ( ) . to_string ( ) ; let mut f = dir . new_file ( & subdir . as_ref ( ) . join ( & merkle ) , 0600 ) . unwrap ( ) ; f . set_len ( buf . len ( ) as u64 ) . unwrap ( ) ; f . write_all ( & buf ) . unwrap ( ) ; merkle }
Writes a blob in the given directory and path, returning the computed merkle root of the blob.
Writes a blob in the given directory and path returning the computed merkle root of the blob .
dir
&openat::Dir
subdir
impl AsRef<Path>
payload
impl Read