Also print byte offset.
Some checks failed
clippy Build clippy has failed
rust-foreign-document-test Build rust-foreign-document-test has failed
rust-build Build rust-build has succeeded
rust-test Build rust-test has succeeded

This commit is contained in:
Tom Alexander 2023-10-17 13:35:40 -04:00
parent a2f53361eb
commit 0208020e3e
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -33,10 +33,11 @@ pub fn report(original_document: &str) {
// results.sort_by(|(_ak, av), (_bk, bv)| bv.cmp(av));
for (key, count) in results {
println!(
"{:?} {} character offset: {}",
"{:?} {} character offset: {} byte offset: {}",
key.event_type,
count,
original_document[..key.byte_offset].chars().count() + 1
original_document[..key.byte_offset].chars().count() + 1,
key.byte_offset
)
}
}