Switch to a numeric post-blank.

Turns out post-blank has different meanings to different object types so we need to return a number to properly do the compare.
This commit is contained in:
Tom Alexander
2023-10-31 22:32:01 -04:00
parent 31406fd520
commit 90ba17b68c
9 changed files with 76 additions and 67 deletions

View File

@@ -128,11 +128,11 @@ fn assert_post_blank<'b, 's, S: StandardProperties<'s> + ?Sized>(
rust: &'b S,
) -> Result<(), Box<dyn std::error::Error>> {
let standard_properties = get_emacs_standard_properties(emacs)?; // 1-based
let rust_post_blank = rust.get_post_blank().chars().count();
let rust_post_blank = rust.get_post_blank();
let emacs_post_blank = standard_properties
.post_blank
.ok_or("Token should have a post-blank.")?;
if rust_post_blank != emacs_post_blank {
if rust_post_blank as usize != emacs_post_blank {
Err(format!("Rust post-blank (in chars) {rust_post_blank} does not match emacs post-blank ({emacs_post_blank})", rust_post_blank = rust_post_blank, emacs_post_blank = emacs_post_blank))?;
}