diff options
author | Akshay <[email protected]> | 2022-01-14 12:39:42 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2022-01-14 12:39:42 +0000 |
commit | 7d732a051e695353db5a3ddbb26ab766ff736043 (patch) | |
tree | aceda0db9a4c1d5ac64b9f061924e36ecf3f8ee9 /lib/src/lints/faster_groupby.rs | |
parent | d1ff222bcf94152cd657233cffd8c14a45788c26 (diff) |
refactor parsing code, simplify tests
Diffstat (limited to 'lib/src/lints/faster_groupby.rs')
-rw-r--r-- | lib/src/lints/faster_groupby.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/src/lints/faster_groupby.rs b/lib/src/lints/faster_groupby.rs index c496125..2a36f5f 100644 --- a/lib/src/lints/faster_groupby.rs +++ b/lib/src/lints/faster_groupby.rs | |||
@@ -27,7 +27,7 @@ use rnix::{ | |||
27 | /// | 27 | /// |
28 | /// Replace `lib.groupBy` with `builtins.groupBy`: | 28 | /// Replace `lib.groupBy` with `builtins.groupBy`: |
29 | /// | 29 | /// |
30 | /// ``` | 30 | /// ```nix |
31 | /// builtins.groupBy (x: if x > 2 then "big" else "small") [ 1 2 3 4 5 6 ]; | 31 | /// builtins.groupBy (x: if x > 2 then "big" else "small") [ 1 2 3 4 5 6 ]; |
32 | /// ``` | 32 | /// ``` |
33 | #[lint( | 33 | #[lint( |
@@ -40,7 +40,7 @@ struct FasterGroupBy; | |||
40 | 40 | ||
41 | impl Rule for FasterGroupBy { | 41 | impl Rule for FasterGroupBy { |
42 | fn validate(&self, node: &SyntaxElement, sess: &SessionInfo) -> Option<Report> { | 42 | fn validate(&self, node: &SyntaxElement, sess: &SessionInfo) -> Option<Report> { |
43 | let lint_version = "nix (Nix) 2.5".parse::<Version>().unwrap(); | 43 | let lint_version = "2.5".parse::<Version>().unwrap(); |
44 | if_chain! { | 44 | if_chain! { |
45 | if sess.version() >= &lint_version; | 45 | if sess.version() >= &lint_version; |
46 | if let NodeOrToken::Node(node) = node; | 46 | if let NodeOrToken::Node(node) = node; |