#terminal #error #terminal-console #utilities

bin+lib highlight_error

Highlights an error for printing

2 releases

0.1.1 Jul 14, 2022
0.1.0 Jul 14, 2022

#66 in #terminal-console

Download history 199/week @ 2024-12-11 124/week @ 2024-12-18 54/week @ 2024-12-25 128/week @ 2025-01-01 110/week @ 2025-01-08 136/week @ 2025-01-15 114/week @ 2025-01-22 139/week @ 2025-01-29 217/week @ 2025-02-05 176/week @ 2025-02-12 136/week @ 2025-02-19 155/week @ 2025-02-26 117/week @ 2025-03-05 222/week @ 2025-03-12 209/week @ 2025-03-19 177/week @ 2025-03-26

743 downloads per month
Used in 19 crates (6 directly)

MIT license

16KB
97 lines

Highlight Error

Rust util that highlights an error.

Example

The code below:

fn main() {
  let code = "functon is_zero (x) {
    if (x == 0) [
      return true;
    ] else {
      return false;
    }
  }";
  println!("{}", highlight_error::highlight_error(38, 64, &code));
}

Will output:

example.png

No runtime deps