Code Review Request — Perquisition, a useful search tool

I'm currently working on learning Rust, and, for practice, I wrote a tool that searches all text files in a directory (a text file is a file with valid Unicode in it) and returns a nice list of any files that contain the given strings. The source is here. It is used like this:

./perquisiton . pub fn

to find, in this example, any text files that are in the current directory (recursively) with "pub" or "fn" in them.

Although my code works (and since it's Rust, this means that it must be safe), I'm not sure if my code is as idiomatic as it could be (it probably isn't) and if my code is as efficient as is reasonable (one of the main reasons for choosing Rust) (also, it probably isn't, just because I'm still new to Rust, although I do know C++ fairly well).

You can get some suggestions from cargo clippy

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.