Crates.io | diff_fmt |
lib.rs | diff_fmt |
version | 0.1.0 |
source | src |
created_at | 2019-10-25 17:40:02.521247 |
updated_at | 2019-10-25 17:40:02.521247 |
description | A simple diff format for color terminals |
homepage | |
repository | https://github.com/the10thWiz/fmt |
max_upload_size | |
id | 175665 |
size | 18,538 |
Usage:
use fmt_diff::*;
println!("{:08b}", diff(&0x0F, &0x07));
The only two public functions, diff
and mask
take two functions, and return a format object. The format object takes the parameters supplied by the format macro, and formats the provided objects.
The diff format will format every character that is the same with a green color, and different characters with a red color. The diff only prints the first object.
The mask format will format every character of the first, colored green if the second is an (ascii) zero, or space, or red otherwise.