Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 416c458

Browse files
VictorHelios-vmg
authored andcommitted
Added assert_const documentation.
1 parent 90de147 commit 416c458

File tree

1 file changed

+3
-0
lines changed
  • apps/nextra/pages/en/build/smart-contracts

1 file changed

+3
-0
lines changed

apps/nextra/pages/en/build/smart-contracts/linter.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Checks for expression patterns that look like a failed swap attempt and notifies
1717
- `a = b; b = a;` which can be correctly swapped with `(a, b) = (b, a);`
1818
- `a.x = b.x; b.x = a.x;` which can be correctly swapped with `(a.x, b.x) = (b.x, a.x);`
1919

20+
### `assert_const`
21+
Checks for trivial assertions, i.e. `assert!(false)` and `assert!(true)`. The latter is equivalent to a no-op, so can be removed entirely, while the former can be replaced by an abort.
22+
2023
### `avoid_copy_on_identity_comparison`
2124

2225
Checks for identity comparisons (`==` or `!=`) between copied values of type `vector` or `struct` (i.e., types for which copy can be expensive). It instead suggests to use reference-based identity comparison instead (i.e., use `&x == &y` instead of `x == y`, when the above mentioned conditions meet).

0 commit comments

Comments
 (0)