aboutsummaryrefslogtreecommitdiff
path: root/bin/tests/snapshots/main__useless_has_attr.snap
diff options
context:
space:
mode:
authorAkshay <[email protected]>2022-02-20 05:25:20 +0000
committerAkshay <[email protected]>2022-02-20 05:31:36 +0000
commitc7874ec26d6499a1196ce23432beb33764490dec (patch)
tree226b8dce61e5f7580be9de7ebde72212bb94f682 /bin/tests/snapshots/main__useless_has_attr.snap
parente8130a90dca048d195603281f72e1af0b4f7ccc6 (diff)
new lint: useless_has_attr
Diffstat (limited to 'bin/tests/snapshots/main__useless_has_attr.snap')
-rw-r--r--bin/tests/snapshots/main__useless_has_attr.snap34
1 files changed, 34 insertions, 0 deletions
diff --git a/bin/tests/snapshots/main__useless_has_attr.snap b/bin/tests/snapshots/main__useless_has_attr.snap
new file mode 100644
index 0000000..df72eaf
--- /dev/null
+++ b/bin/tests/snapshots/main__useless_has_attr.snap
@@ -0,0 +1,34 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W19] Warning: This `if` expression can be simplified with `or`
7 ╭─[data/useless_has_attr.nix:3:4]
8
9 3 │ (if x ? a then x.a else default)
10 · ───────────────┬──────────────
11 · ╰──────────────── Consider using x.a or default instead of this if expression
12───╯
13[W19] Warning: This `if` expression can be simplified with `or`
14 ╭─[data/useless_has_attr.nix:4:4]
15
16 4 │ (if x.a ? b then x.a.b else default)
17 · ─────────────────┬────────────────
18 · ╰────────────────── Consider using x.a.b or default instead of this if expression
19───╯
20[W19] Warning: This `if` expression can be simplified with `or`
21 ╭─[data/useless_has_attr.nix:5:4]
22
23 5 │ (if x ? a.b then x.a.b else default)
24 · ─────────────────┬────────────────
25 · ╰────────────────── Consider using x.a.b or default instead of this if expression
26───╯
27[W19] Warning: This `if` expression can be simplified with `or`
28 ╭─[data/useless_has_attr.nix:8:4]
29
30 8 │ (if x ? a then x.a else if b then c else d)
31 · ────────────────────┬────────────────────
32 · ╰────────────────────── Consider using x.a or (if b then c else d) instead of this if expression
33───╯
34