summaryrefslogtreecommitdiff
path: root/crates/tor-consdiff/src/err.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-consdiff: Enforce Unix line endingsClara Engler2026-03-251-3/+3
| | | | | | | | | | This commit changes the consdiff generation to enforce Unix line endings and reject all other ones, including Windows line endings as well as no line endings. In other words, it checks for `\n` while forbidding `\r\n`. It also renames the relevant error variant to reflect this change better.
* tor-consdiff: Use named variants for lno errorsClara Engler2026-03-251-4/+10
| | | | | | This commit changes the error variants that contain a line number to a named variant with a field `lno: usize` to make it semantically clear, that it is a line number.
* tor-consdiff: Remove manual line splitsClara Engler2026-03-251-0/+4
| | | | | | | | | This commit removes all manual line splits in the consdiff generation. Instead, it now simply uses the primitives offered by imara-diff to access the lines in the input itself. Meanwhile, it also adds a check for missing newlines/assertions that all lines are actually terminated by \n.
* tor-consdiff: Return error for dotlineClara Engler2026-03-251-0/+16
| | | | | This commit adds a check that prevents gen_cons_diff from computing a diff with a single dot line.
* tor-consdiff: Failed applies are a BugClara Engler2026-03-251-3/+9
| | | | | | Mark a failed apply from a consensus diff we generate as a bug as this should not happen. We must obviously always accept the consensus diffs we produce.
* tor-consdiff: Add consdiff generation algorithmClara Engler2026-03-251-0/+16
| | | | | | | | This commit implements support for the consensus diff generation. Unlike CTor, it does not use its own custom algorithm but rather uses an implementation of Myers' algorithm from the `imara-diff` crate, which is pretty performant and comparable to size and run time to CTor, while being much simpler in the interfacing code.
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+32
This will cause some pain for now, but now is really the best time to do this kind of thing.