Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/the10thwiz/fmt
https://github.com/the10thwiz/fmt
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/the10thwiz/fmt
- Owner: the10thWiz
- Created: 2019-10-25T17:02:36.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-25T17:43:05.000Z (about 5 years ago)
- Last Synced: 2024-09-14T09:12:52.659Z (about 2 months ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# A simple diff and mask format for color terminals
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.
## Notes:
Unfortunately, it would appear that this crate requires the nightly toolchain, becuase it uses the `std::fmt` internals