You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compile-time type system uses **cons-cell heterogeneous lists** (`CStackList<H,T>` / `CNil`) defined in `c_stack_list.rs` and `list_traits.rs`.
64
83
@@ -77,6 +96,7 @@ The compile-time type system uses **cons-cell heterogeneous lists** (`CStackList
77
96
## Code Style
78
97
79
98
### Avoid heap allocations
99
+
80
100
- Pass `&str` / `&[T]` rather than cloning into `String` / `Vec<T>`
81
101
- Use generics or `fn` pointers instead of `Box<dyn Trait>` when the type set is statically known
82
102
- Return `&[T]` or `impl Iterator` over owned collections when the data already lives elsewhere
@@ -98,11 +118,13 @@ Every function must have a `///` doc comment written in **contract style**. The
98
118
If you cannot write a simple contract for a function, treat that as a signal that the design needs improvement.
99
119
100
120
Additional rules:
121
+
101
122
- For parser functions, the grammar production is the summary: `/// \`additive_expression = multiplicative_expression { ("+" | "-") multiplicative_expression }.\``
102
123
- Use `# Examples` for all public APIs.
103
124
- Modules use `//!` with a usage tutorial.
104
125
105
126
**Example:**
127
+
106
128
```rust
107
129
/// Removes and returns the top element.
108
130
///
@@ -123,4 +145,5 @@ Derive tests from the **contract and public interface only** — do not read or
0 commit comments