Use character offsets in diff.

This commit is contained in:
Tom Alexander
2023-08-29 21:49:16 -04:00
parent eaa38ce772
commit f170a557ed
4 changed files with 5 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ pub fn assert_bounds<'s, S: Source<'s>>(
);
let (rust_begin, rust_end) = get_offsets(source, rust);
if (rust_begin + 1) != begin || (rust_end + 1) != end {
Err(format!("Rust bounds ({rust_begin}, {rust_end}) do not match emacs bounds ({emacs_begin}, {emacs_end})", rust_begin = rust_begin + 1, rust_end = rust_end + 1, emacs_begin=begin, emacs_end=end))?;
Err(format!("Rust bounds (in bytes) ({rust_begin}, {rust_end}) do not match emacs bounds ({emacs_begin}, {emacs_end})", rust_begin = rust_begin + 1, rust_end = rust_end + 1, emacs_begin=begin, emacs_end=end))?;
}
Ok(())