Use a built-in type definition.
Section: Type filters
Search only Rust files
bash
bash
rg -t rust 'Result<' .Explanation
Type filters are easier to read and reuse than complex globs.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Type filters
Define a custom file type on the command line
Create a reusable ad hoc type mapping.
Add a custom type and search it immediately
Define and use the type in the same command.