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

Commit e3fbc92

Browse files
Helios-vmgVictor
andauthored
Added assert_const documentation to linter page (#976)
Added assert_const documentation. Co-authored-by: Victor <[email protected]>
1 parent 098e260 commit e3fbc92

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
@@ -34,6 +34,9 @@ Checks for expression patterns that look like a failed swap attempt and notifies
3434
- `a = b; b = a;` which can be correctly swapped with `(a, b) = (b, a);`
3535
- `a.x = b.x; b.x = a.x;` which can be correctly swapped with `(a.x, b.x) = (b.x, a.x);`
3636

37+
### `assert_const`
38+
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.
39+
3740
### `avoid_copy_on_identity_comparison`
3841

3942
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)