Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 865 Bytes

CODING_STYLE.md

File metadata and controls

27 lines (20 loc) · 865 Bytes

Coding Style

Table of Content

General

The coding style for Rust code follows the Rust Style Guide

Exceptions:

  • Each indentation level is 2 spaces.

Assertions

Assertions should never be reachable by any sequence of API calls.

Assertions should never be reachable by any sequence of crav1e API calls which do not depend on C undefined behavior, or contain pointers that cause invalid behavior when accessed.

Prefer assert()! to debug_assert()! in the following situations:

  • Unsafe code.
  • Code called once per tile or less where debug build testing is unlikely to expose errors (for example, the tests are #[ignored] by default, or it is not covered by unit tests at all)