CodeChain-io / CodeChain-io/codechain

Need an assertion policy

Open
#197 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
256
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Currently, we use `debug_assert` in most cases because we check the assertions in tests and we don't want to check them again in the release binary.

But it's not sustainable. Bugs will occur for any reason. It seems better to use `assert` to crash early because we have a plan to add [a bug tracker](https://github.com/CodeChain-io/codechain/issues/196).

I think we need a guideline to decide when to use `assert` or `debug_assert`.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the current uses of `assert` and `debug_assert` across the Rust codebase, since the issue names no specific files or tests. Define the project guideline for choosing between them and document it in the project's appropriate guidance location; done means the policy is clear enough to apply consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.