Skip to content

The README usage example panics #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
digama0 opened this issue Mar 6, 2021 · 0 comments · Fixed by #44
Closed

The README usage example panics #43

digama0 opened this issue Mar 6, 2021 · 0 comments · Fixed by #44

Comments

@digama0
Copy link
Contributor

digama0 commented Mar 6, 2021

$ cargo run
   Compiling annotate-snippets v0.9.0
   Compiling rust-test v0.1.0 (/home/mario/Documents/rust-test)
    Finished dev [unoptimized + debuginfo] target(s) in 0.92s
     Running `target/debug/rust-test`
thread 'main' panicked at 'SourceAnnotation range `(205, 207)` is bigger than source length `195`', /home/mario/.cargo/registry/src/github.com-1ecc6299db9ec823/annotate-snippets-0.9.0/src/display_list/from_snippet.rs:287:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Appears to be an issue with the index into the source, which is in fact 195 characters long. Based on the error message I guess it should be highlighting the 22, which would be (187, 189), not (205, 207).

digama0 added a commit to digama0/annotate-snippets-rs that referenced this issue Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant