DeepSource
Dashboard Resources Pricing Discover Directory Log in

Run your first analysis.

Find thousands of code security and quality issues in your codebase, before they end up in production.

Start now
All analyzers Rust
Rust

Rust

Use Analyzer
Docs
Discuss

Categories

Programming language

Latest version

v0.5.1

Updated on

Jan 16, 2023

Issues

203

Autofix

62

Read full documentation

Sample configuration


version = 1

[[analyzers]]
name = "rust"
enabled = true

  [analyzers.meta]
  msrv = "stable"

Stats


Anti-pattern

120

Bug risk

47

Documentation

1

Performance

12

Security

23

Issues


View all
Unneeded wildcard pattern RS-C1004
Anti-pattern
Autofix

In tuple or struct patterns, zero or more "remaining" elements can be discarded using the rest (..) pattern and exactly one element can be discarded using the wildcard pattern (_). This checker looks for wildcard patterns next to a rest pattern. The wildcard is unnecessary because the rest pattern can match that element as well.

Found unnecessary fold RS-W1022
Anti-pattern
Autofix

Certain forms of fold have concise alternatives, such as sum, product, any or all. Prefer these forms where applicable as they improve readability.

This match statement can be collapsed into an if-else statement RS-W1007
Anti-pattern
Autofix

match statements with only one useful arm can be reduced to an if-else statement. This helps improve readability, an if-else statement nests lesser than a match.