2 unstable releases
0.2.0 | Jan 6, 2019 |
---|---|
0.1.0 | Jan 6, 2019 |
#209 in #demo
5KB
grrs-lazy
A simple search utility, based on the rust
cli-wg
tutorial:
https://rust-lang-nursery.github.io/cli-wg/tutorial/
It has a few differences from the final grrs
built in the tutorial:
- Separated out
find_matches
insrc/lib.rs
. - Using
std::io::BufReader
instead ofstd::fs::read_to_string
, so that we avoid loading all the content from a file in memory. - Dealing with iterators in
find_matches
, so that the processing is done in a lazy stream.
Installation
To install, run:
cargo install grrs-lazy
You can then search for lines in a text file:
$ grrs-lazy Sherlock path/to/the-adventures-of-sherlock-holmes.txt | wc -c
6089
Dependencies
~6–14MB
~177K SLoC