| CARVIEW |
Select Language
HTTP/2 200
server: GitHub.com
content-type: text/html; charset=utf-8
last-modified: Tue, 16 Dec 2025 15:39:33 GMT
access-control-allow-origin: *
etag: W/"69417d35-612a"
expires: Sat, 27 Dec 2025 06:53:23 GMT
cache-control: max-age=600
content-encoding: gzip
x-proxy-cache: MISS
x-github-request-id: 94B5:292AC1:607FE3:6C10BD:694F800B
accept-ranges: bytes
age: 0
date: Sat, 27 Dec 2025 06:43:23 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210086-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1766817803.478808,VS0,VE201
vary: Accept-Encoding
x-fastly-request-id: 73d2a74dc4b4bbb26e746f04562850f96fa7b403
content-length: 6769
Skipping untestable code - cargo-mutants
Keyboard shortcuts
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
Skipping untestable code
Some functions may be inherently hard to cover with tests, for example if:
- Generated mutants cause tests to hang.
- You’ve chosen to test the functionality by human inspection or some higher-level integration tests.
- The function has side effects or performance characteristics that are hard to test.
- You’ve decided the function is not important to test.
There are three ways to skip mutating some code:
- Marking the function with an attribute within the source file.
- Filtering by path in the config file or command line.
- Filtering by function and mutant name in the config file or command line.
The results of all these filters can be previewed using the --list option.
Which filtering method to use?
- If some particular functions are hard to test with cargo-mutants, use an attribute, so that the skip is visible in the code.
- If a whole module is untestable, use a filter by path in the config file, so that the filter’s stored in the source tree and covers any new code in that module.
- If you want to permanently ignore a class of functions, such as
Debugimplementations, use a regex filter in the config file. - If you want to run cargo-mutants just once, focusing on a subset of files, functions, or mutants, use command line options to filter by name or path.