@@ -428,7 +428,7 @@ selection of possible matches is produced by the pattern syntax. In the second
428
428
stage, the named subpattern references can be used to do additional tests like
429
429
asserting that a node hasn't been created as part of a macro expansion.
430
430
431
- ## Implementing clippy lints using patterns
431
+ ## Implementing Clippy lints using patterns
432
432
433
433
As a "real-world" example, I re-implemented the ` collapsible_if ` lint using
434
434
patterns. The code can be found
@@ -572,7 +572,7 @@ The pattern syntax and the *PatternTree* are independent of specific syntax tree
572
572
implementations (rust ast / hir, syn, ...). When looking at the different
573
573
pattern examples in the previous sections, it can be seen that the patterns
574
574
don't contain any information specific to a certain syntax tree implementation.
575
- In contrast, clippy lints currently match against ast / hir syntax tree nodes
575
+ In contrast, Clippy lints currently match against ast / hir syntax tree nodes
576
576
and therefore directly depend on their implementation.
577
577
578
578
The connection between the * PatternTree* and specific syntax tree
@@ -690,7 +690,7 @@ change, only the `IsMatch` trait implementations need to be adapted and existing
690
690
lints can remain unchanged. This also means that if the ` IsMatch ` trait
691
691
implementations were integrated into the compiler, updating the ` IsMatch `
692
692
implementations would be required for the compiler to compile successfully. This
693
- could reduce the number of times clippy breaks because of changes in the
693
+ could reduce the number of times Clippy breaks because of changes in the
694
694
compiler. Another advantage of the pattern's independence is that converting an
695
695
` EarlyLintPass ` lint into a ` LatePassLint ` wouldn't require rewriting the whole
696
696
pattern matching code. In fact, the pattern might work just fine without any
@@ -777,7 +777,7 @@ complexity to solve a relatively minor problem.
777
777
778
778
The issue of users not knowing about the * PatternTree* structure could be solved
779
779
by a tool that, given a rust program, generates a pattern that matches only this
780
- program (similar to the clippy author lint).
780
+ program (similar to the Clippy author lint).
781
781
782
782
For some simple cases (like the first example above), it might be possible to
783
783
successfully mix Rust and pattern syntax. This space could be further explored
@@ -789,7 +789,7 @@ The pattern syntax is heavily inspired by regular expressions (repetitions,
789
789
alternatives, sequences, ...).
790
790
791
791
From what I've seen until now, other linters also implement lints that directly
792
- work on syntax tree data structures, just like clippy does currently. I would
792
+ work on syntax tree data structures, just like Clippy does currently. I would
793
793
therefore consider the pattern syntax to be * new* , but please correct me if I'm
794
794
wrong.
795
795
@@ -982,5 +982,5 @@ pattern!{
982
982
}
983
983
```
984
984
985
- In the future, clippy could use this system to also provide lints for custom
985
+ In the future, Clippy could use this system to also provide lints for custom
986
986
syntaxes like those found in macros.
0 commit comments