Removing an unwrap during file moves

pmeunier
Jan 1, 2022, 11:14 AM
GXK2FNX7G7K4SXS52YHKUR4AEZMVH4KZAPQP2QDGPIF7QLXDCHHQC

Dependencies

  • [2] ZDK3GNDB Tag transactions (including a massive refactoring of errors)
  • [3] 2RXOCWUW Making libpijul deterministic (and getting rid of `rand`)
  • [4] YN63NUZO Sanakirja 1.0
  • [5] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [6] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).

Change contents

  • edit in libpijul/src/fs.rs at line 25
    [2.34339]
    [3.101531]
    #[error("Inode not found")]
    InodeNotFound(Inode),
  • edit in libpijul/src/fs.rs at line 40
    [2.34525]
    [2.34525]
    FsError::InodeNotFound(inode) => write!(fmt, "Inode not found: {}", inode.to_base32()),
  • replacement in libpijul/src/fs.rs at line 297
    [2.35963][3.130469:130539](),[3.104619][3.130469:130539]()
    let fileref = txn.get_revtree(&inode, None)?.unwrap().to_owned();
    [2.35963]
    [3.746213]
    debug!("inode = {:?}", inode);
    let fileref = if let Some(inode) = txn.get_revtree(&inode, None)? {
    inode.to_owned()
    } else {
    return Err(FsError::InodeNotFound(inode));
    };