1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//! Idiomatic Rust transformations
//!
//! Mechanical transformations between equivalent Rust constructs.
//! These are safe, behavior-preserving changes that improve code style.
//!
//! # Clippy Integration
//!
//! Many of these mutations correspond to Clippy lints and can be automatically
//! triggered via the [`crate::clippy`] module. See the clippy module
//! documentation for the full mapping.
//!
//! # Categories
//!
//! ## Tier 1: High-frequency Clippy lints
//!
//! | Mutation | Clippy Lint | Description |
//! |----------|-------------|-------------|
//! | [`BoolSimplifyMutation`] | `bool_comparison` | `x == true` → `x` |
//! | [`CollapsibleIfMutation`] | `collapsible_if` | Merge nested if statements |
//! | [`ComparisonToMethodMutation`] | `comparison_to_empty` | `s == ""` → `s.is_empty()` |
//! | [`AssignOpMutation`] | `assign_op_pattern` | `a = a + b` → `a += b` |
//! | [`CloneOnCopyMutation`] | `clone_on_copy` | Remove `.clone()` on Copy types |
//! | [`RedundantClosureMutation`] | `redundant_closure` | `\|x\| f(x)` → `f` |
//! | [`FilterNextMutation`] | `filter_next` | `.filter().next()` → `.find()` |
//! | [`MapUnwrapOrMutation`] | `map_unwrap_or` | `.map().unwrap_or()` → `.map_or()` |
//!
//! ## Tier 2: Pattern transformations
//!
//! | Mutation | Description |
//! |----------|-------------|
//! | [`ManualMapMutation`] | `match opt { Some(x) => Some(f(x)), None => None }` → `opt.map(f)` |
//! | [`LoopToIteratorMutation`] | `for x in iter { v.push(f(x)) }` → `iter.map(f).collect()` |
//! | [`UnwrapToQuestionMutation`] | `.unwrap()` → `?` in functions returning Result/Option |
//!
//! ## Tier 3: Code generation (Design patterns)
//!
//! | Mutation | Description |
//! |----------|-------------|
//! | [`DefaultMutation`] | Add Default impl to structs |
//! | [`DeriveDefaultMutation`] | Convert manual impl Default to derive |
//!
//! ## Tier 4: Performance/Safety
//!
//! | Mutation | Description |
//! |----------|-------------|
//! | [`UseAtomicMutation`] | Suggest Mutex → Atomic for simple fields |
//! | [`UseRwLockMutation`] | Suggest Mutex → RwLock for read-heavy access |
//! | [`LockScopeMutation`] | Detect locks held across await points |
//!
//! ## Utilities
//!
//! | Mutation | Description |
//! |----------|-------------|
//! | [`OrganizeImportsMutation`] | Sort and group use statements |
//! | [`IntroduceVariableMutation`] | Extract repeated expressions into variables |
//! | [`MatchToIfLetMutation`] | Convert simple match to if let |
// Tier 1: Clippy high-frequency lints
pub use AssignOpMutation;
pub use BoolSimplifyMutation;
pub use CloneOnCopyMutation;
pub use CollapsibleIfMutation;
pub use ComparisonToMethodMutation;
pub use FilterNextMutation;
pub use MapUnwrapOrMutation;
pub use NoOpArmToTodoMutation;
pub use RedundantClosureMutation;
// Tier 2: Pattern transformations
pub use ;
pub use ;
pub use ManualMapMutation;
pub use MatchToIfLetMutation;
pub use OrganizeImportsMutation;
pub use UnwrapToQuestionMutation;
// Tier 3: Code generation (Design patterns)
pub use ;
// Tier 4: Performance/Safety
pub use ;