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XRDTVKMJZCKFONSXUZMAZB7VC7OHDCGAVCOQC
Either::A((txn, mut change, updates, hash, oldest)) => {
let hash = hash.unwrap();
change.unhashed = Some(serde_json::json!({
"signature": key.sign_raw(&hash.to_bytes())?,
}));
Either::A((txn, mut change, updates, oldest)) => {
let hash = repo.changes.save_change(&mut change, |change, hash| {
change.unhashed = Some(serde_json::json!({
"signature": key.sign_raw(&hash.to_bytes()).unwrap(),
}));
Ok::<_, anyhow::Error>(())
})?;
let change = libpijul::change::Change::read(&mut change, &mut HashMap::default())?;
hashes.push(repo.changes.save_change(&change)?)
let mut change = libpijul::change::Change::read(&mut change, &mut HashMap::default())?;
hashes.push(
repo.changes
.save_change(&mut change, |_, _| Ok::<_, anyhow::Error>(()))?,
)
fn save_change(&self, p: &Change) -> Result<Hash, Self::Error> {
let mut f = tempfile::NamedTempFile::new_in(&self.changes_dir)?;
fn save_change<E: From<Self::Error> + From<ChangeError>, F: FnOnce(&mut Change, &Hash) -> Result<(), E>>(&self, p: &mut Change, ff: F) -> Result<Hash, E> {
let mut f = match tempfile::NamedTempFile::new_in(&self.changes_dir) {
Ok(f) => f,
Err(e) => return Err(E::from(Error::from(e)))
};
bincode::serialize_into(&mut w, &offsets)?;
w.write_all(&hashed_comp)?;
w.write_all(&unhashed_comp)?;
w.write_all(&contents_comp)?;
bincode::serialize_into(&mut w, &offsets).map_err(From::from)?;
w.write_all(&hashed_comp).map_err(From::from)?;
w.write_all(&unhashed_comp).map_err(From::from)?;
w.write_all(&contents_comp).map_err(From::from)?;
debug!("change serialized");