跟着 Rust 官方的 “The Rust Programing Language” 中的 第12章 编写的一个小程序, 使用指定的关键字过滤文本文件内容, 并输出相关的行.
然后下载代码
git clone https://github.com/jason1105/minigrep.git
尝试运行一下
cd minigrep
cargo run <query> <filename>
# 例如 cargo run to poem.txt
还可以编译成 exe
cargo build --release