Fixing yet another instance of `&name[2..]` (replaced with the encoding detector)

pmeunier
Jun 29, 2021, 12:40 PM
FTR3UCBENLZOJ2OO5FHI66MC6VSBLG7UOL47MGVKKXD6XL2DWYEQC

Dependencies

  • [2] YN63NUZO Sanakirja 1.0
  • [3] I52XSRUH Massive cleanup, and simplification
  • [4] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [5] VO5OQW4W Removing anyhow in libpijul
  • [6] GHO6DWPI Refactoring iterators
  • [7] 3AMEP2Y5 More convenient interface for channels
  • [8] IIV3EL2X Cleanup, formatting, and fixing the Git feature
  • [9] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).

Change contents

  • replacement in libpijul/src/fs.rs at line 819
    [3.32253][3.759934:760027](),[3.113643][3.759934:760027](),[3.759934][3.759934:760027](),[3.760027][2.132908:132987](),[3.6074][3.760104:760467](),[3.62880][3.760104:760467](),[2.132987][3.760104:760467](),[3.760104][3.760104:760467]()
    if std::str::from_utf8(&name_buf[2..]) == Ok(c) {
    let age = txn
    .get_changeset(txn.changes(&channel), &name.dest().change)
    .unwrap();
    if let Some((ref mut next, ref mut next_age)) = next {
    ambiguous = true;
    if age < *next_age {
    *next = name_dest;
    *next_age = age;
    }
    } else {
    next = Some((name_dest, age));
    [3.113643]
    [3.760467]
    let FileMetadata { basename, .. } = FileMetadata::read(&name_buf);
    let age = txn
    .get_changeset(txn.changes(&channel), &name.dest().change)
    .unwrap();
    if let Some((ref mut next, ref mut next_age)) = next {
    ambiguous = true;
    if age < *next_age {
    *next = name_dest;
    *next_age = age;
  • edit in libpijul/src/fs.rs at line 829
    [3.760485]
    [3.760485]
    } else {
    next = Some((name_dest, age));