据说学 Rust 的人中,有不少是前端的,主要是很多前端工具链采用 Rust 重写。不仅如此,终端命令工具,也有很多 Rust 的轮子。所以,学学 Rust 造 command line 工具的轮子,对学习 Rust 挺好。
前几天发现有一本专门讲解 Rust 实现命令行工具的书,推荐给大家。
https://www.oreilly.com/library/view/command-line-rust/9781098109424/
这本书不是专注于整个语言,而是在每一章中使用一个小型、完整的程序来讲解 Rust。作者 Ken Youens-Clark 向你展示了如何启动、编写和测试每个程序以创建成品。你将学习如何处理 Rust 中的错误、读写文件以及使用正则表达式、Rust 类型、结构等等。
本书的目录如下:
1. Truth or Consequences
2. Test for Echo
3. On the Catwalk
4. Head Aches
5. Word to Your Mother
6. Den of Uniquity
7. Finders Keepers
8. Shave and a Haircut
9. Jack the Grepper
10. Boston Commons
11. Tailor Swyfte
12. Fortunate Son
13. Rascalry
14. Elless Island
Epilogue
Index
About the Author