chore: leftover non-behavioral cleanup

Chasesomero
Mar 14, 2026, 3:10 PM
U52IWOWBDAITDO4RZQ4ADGWA64YC7TS4AILWHXDIGOPTF3FNSJGQC

Dependencies

  • [2] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [3] VO5OQW4W Removing anyhow in libpijul
  • [4] CCFJ7VO3 Renaming "Record" to "Hunk" in the changes
  • [5] YN63NUZO Sanakirja 1.0
  • [6] IIV3EL2X Cleanup, formatting, and fixing the Git feature
  • [7] RMDMAYRX Adding a root inode (aka supporting submodules)
  • [8] FGIVSUFH Fixing conflicts with the new patch parsing code, and introducing AddRoot
  • [9] AF5AKUTO Cleanup after the text changes refactoring
  • [10] RVAH6PXA Getting libpijul to compile to WASM32
  • [11] FMLTNQ4E Turning a panic into an error when making a patch
  • [12] QWIYNMI5 Formatting + big-endian Sanakirja
  • [13] RIZ4IP76 Solving more conflicts
  • [14] HP7CKJIW Fixing a bug in unrecord
  • [15] 5H2UH7R5 Make pub Encoding, Encoding::decode and change::get_change_contents
  • [16] AECQFAME Updating dependencies
  • [17] 4USQK3IW Big rename: libpijul => pijul-core, to match all other crates in the ecosystem
  • [18] GHO6DWPI Refactoring iterators
  • [19] I52XSRUH Massive cleanup, and simplification
  • [20] 5FI6SBEZ Re-implement change printing and parsing
  • [21] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [22] I24UEJQL Various post-fire fixes

Change contents

  • replacement in pijul-core/src/small_string.rs at line 314
    [2.487787][17.10376:10434](),[16.49][5.47596:47657](),[13.91][5.47596:47657](),[17.10434][5.47596:47657](),[12.12089][5.47596:47657](),[5.47596][5.47596:47657](),[5.47657][6.6176:6296](),[6.6296][17.10435:10520](),[17.10520][5.47816:47849](),[5.47816][5.47816:47849](),[5.47849][17.10521:10588](),[17.10588][5.47906:47937](),[5.47906][5.47906:47937](),[5.47937][6.6297:6416](),[6.6416][5.48020:48036](),[5.48020][5.48020:48036](),[5.48036][17.10589:10596]()
    unsafe fn write_to_page(&self, p: *mut u8) { unsafe {
    std::ptr::copy(&self.len, p, 1 + self.len as usize);
    debug!(
    "writing {:?}",
    std::slice::from_raw_parts(p, 1 + self.len as usize)
    );
    }}
    unsafe fn from_raw_ptr<'a, T>(_: &T, p: *const u8) -> &'a Self { unsafe {
    smallstr_from_raw_ptr(p)
    }}
    unsafe fn onpage_size(p: *const u8) -> usize { unsafe {
    let len = *p as usize;
    debug!(
    "onpage_size {:?}",
    std::slice::from_raw_parts(p, 1 + len as usize)
    );
    1 + len
    }}
    [2.487787]
    [2.487787]
    unsafe fn write_to_page(&self, p: *mut u8) {
    unsafe {
    std::ptr::copy(&self.len, p, 1 + self.len as usize);
    debug!(
    "writing {:?}",
    std::slice::from_raw_parts(p, 1 + self.len as usize)
    );
    }
    }
    unsafe fn from_raw_ptr<'a, T>(_: &T, p: *const u8) -> &'a Self {
    unsafe { smallstr_from_raw_ptr(p) }
    }
    unsafe fn onpage_size(p: *const u8) -> usize {
    unsafe {
    let len = *p as usize;
    debug!(
    "onpage_size {:?}",
    std::slice::from_raw_parts(p, 1 + len as usize)
    );
    1 + len
    }
    }
  • replacement in pijul-core/src/change.rs at line 22
    [10.1537][15.105:194]()
    pub use text_changes::{get_change_contents, TextDeError, TextSerError, WriteChangeLine};
    [10.1537]
    [3.36136]
    pub use text_changes::{TextDeError, TextSerError, WriteChangeLine, get_change_contents};
  • replacement in pijul-core/src/change.rs at line 303
    [2.838610][17.15059:15132](),[17.15132][11.213:226](),[11.213][11.213:226](),[11.226][17.15133:15146](),[17.15146][12.34844:34896](),[11.239][12.34844:34896](),[12.34896][17.15147:15155]()
    let from = match txn.find_block_end(channel, e_from) { Ok(from) => {
    from
    } _ => {
    return Err(MakeChangeError::InvalidChange);
    }};
    [2.838610]
    [5.138571]
    let from = match txn.find_block_end(channel, e_from) {
    Ok(from) => from,
    _ => {
    return Err(MakeChangeError::InvalidChange);
    }
    };
  • replacement in pijul-core/src/change.rs at line 345
    [2.839506][17.15156:15225](),[17.15225][11.404:415](),[11.404][11.404:415](),[11.415][17.15226:15239](),[17.15239][12.34897:34949](),[11.428][12.34897:34949](),[12.34949][17.15240:15248]()
    let mut to = match txn.find_block(channel, to_pos) { Ok(to) => {
    to
    } _ => {
    return Err(MakeChangeError::InvalidChange);
    }};
    [2.839506]
    [14.2704]
    let mut to = match txn.find_block(channel, to_pos) {
    Ok(to) => to,
    _ => {
    return Err(MakeChangeError::InvalidChange);
    }
    };
  • replacement in pijul-core/src/change.rs at line 850
    [2.853372][17.15334:15385](),[17.15385][2.853421:853445](),[2.853421][2.853421:853445](),[2.853445][17.15386:15447](),[17.15447][2.853502:853526](),[2.853502][2.853502:853526](),[2.853526][17.15448:15504](),[17.15504][2.853578:853602](),[2.853578][2.853578:853602](),[2.853602][4.4256:4309](),[4.4309][2.853657:853749](),[2.853657][2.853657:853749](),[2.853749][4.4310:4367](),[4.4367][2.853808:853899](),[2.853808][2.853808:853899](),[2.853899][4.4368:4402](),[4.4402][2.853935:854091](),[2.853935][2.853935:854091](),[2.854091][4.4403:4435](),[4.4435][2.854125:854409](),[2.854125][2.854125:854409](),[2.854409][4.4436:4669](),[4.4669][2.854650:854860](),[2.854650][2.854650:854860](),[2.854860][4.4670:4889](),[4.4889][8.400:560](),[8.560][9.1440:1458](),[8.579][2.855085:855099](),[9.1458][2.855085:855099](),[4.4889][2.855085:855099](),[7.27601][2.855085:855099](),[2.855085][2.855085:855099](),[2.855099][17.15505:15522](),[17.15522][2.855116:855133](),[2.855116][2.855116:855133](),[2.855133][17.15523:15538]()
    match self.extra.take() { Some(extra) => {
    Some(extra)
    } _ => { match self.extra2.take() { Some(extra) => {
    Some(extra)
    } _ => { match self.rec.take() { Some(rec) => {
    match rec {
    Hunk::FileMove { del, add, .. } => {
    self.extra = Some(add);
    Some(del)
    }
    Hunk::FileDel { del, contents, .. } => {
    self.extra = contents;
    Some(del)
    }
    Hunk::FileUndel {
    undel, contents, ..
    } => {
    self.extra = contents;
    Some(undel)
    }
    Hunk::FileAdd {
    add_name,
    add_inode,
    contents,
    ..
    } => {
    self.extra = Some(add_inode);
    self.extra2 = contents;
    Some(add_name)
    }
    Hunk::SolveNameConflict { name, .. } => Some(name),
    Hunk::UnsolveNameConflict { name, .. } => Some(name),
    Hunk::Edit { change, .. } => Some(change),
    Hunk::Replacement {
    change,
    replacement,
    ..
    } => {
    self.extra = Some(replacement);
    Some(change)
    }
    Hunk::SolveOrderConflict { change, .. } => Some(change),
    Hunk::UnsolveOrderConflict { change, .. } => Some(change),
    Hunk::ResurrectZombies { change, .. } => Some(change),
    Hunk::AddRoot { inode, name } | Hunk::DelRoot { inode, name } => {
    self.extra = Some(inode);
    Some(name)
    }
    }
    } _ => {
    None
    }}}}}}
    [2.853372]
    [2.855143]
    match self.extra.take() {
    Some(extra) => Some(extra),
    _ => match self.extra2.take() {
    Some(extra) => Some(extra),
    _ => match self.rec.take() {
    Some(rec) => match rec {
    Hunk::FileMove { del, add, .. } => {
    self.extra = Some(add);
    Some(del)
    }
    Hunk::FileDel { del, contents, .. } => {
    self.extra = contents;
    Some(del)
    }
    Hunk::FileUndel {
    undel, contents, ..
    } => {
    self.extra = contents;
    Some(undel)
    }
    Hunk::FileAdd {
    add_name,
    add_inode,
    contents,
    ..
    } => {
    self.extra = Some(add_inode);
    self.extra2 = contents;
    Some(add_name)
    }
    Hunk::SolveNameConflict { name, .. } => Some(name),
    Hunk::UnsolveNameConflict { name, .. } => Some(name),
    Hunk::Edit { change, .. } => Some(change),
    Hunk::Replacement {
    change,
    replacement,
    ..
    } => {
    self.extra = Some(replacement);
    Some(change)
    }
    Hunk::SolveOrderConflict { change, .. } => Some(change),
    Hunk::UnsolveOrderConflict { change, .. } => Some(change),
    Hunk::ResurrectZombies { change, .. } => Some(change),
    Hunk::AddRoot { inode, name } | Hunk::DelRoot { inode, name } => {
    self.extra = Some(inode);
    Some(name)
    }
    },
    _ => None,
    },
    },
    }