Crates.io | splat |
lib.rs | splat |
version | 0.1.0 |
source | src |
created_at | 2020-05-20 04:29:11.650454 |
updated_at | 2020-05-20 04:29:11.650454 |
description | Error handling and highlighting for source files. |
homepage | |
repository | |
max_upload_size | |
id | 243671 |
size | 25,047 |
Simple error handling and highlighting for source files.
let mut src = Source::new("my-file.txt", "The quick brown fox...");
src.add_message(0..0, "All of my problems start here.");
src.add_message(4..8, "Turns out this isn't quick.");
src.add_message(16..18, "And it's not a fox!");
// Pretty print the messages:
println!("{}", src);
#1 - All of my problems start here.
my-file.txt:1:1
#2 - Turns out this isn't quick.
my-file.txt:1:5
#3 - And it's not a fox!
my-file.txt:1:17
1 │ The quick brown fox...
│ │ ├───┘ │ │
│ │ │ ├─┘
│ 1 2 3
│