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
Copy file name to clipboardExpand all lines: noir-projects/aztec-nr/CLAUDE.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@
7
7
## Noir Idioms
8
8
9
9
- Use `panic("message")` instead of `assert(false, "message")` for unconditional failures. `panic` returns the parent function's return type, making it usable in expression position (e.g. in if/else branches). Even when the return type doesn't matter, `panic` is the idiomatic choice.
10
+
-**Early `return` is not supported in Noir.** You cannot use `return` or `return value` to exit a function early. Instead, restructure the code using `if/else` branches so that all paths lead to the end of the function with a single return expression. For example, instead of `if cond { return None; } ... Some(result)`, write `if cond { Option::none() } else { ... Option::some(result) }`.
std::static_assert(event_serialized_len <= $max_event_serialized_len, f"{event_type_name} has a serialized length of {event_serialized_len} fields, which exceeds the maximum allowed length of {max_event_serialized_len} fields. See https://docs.aztec.network/errors/5");
letmax_note_packed_len: u32 = $max_note_packed_len; // Casting to u32 to avoid the value to be printed in hex.
51
-
letnote_packed_len = <$typasPackable>::N;
52
-
std::static_assert(note_packed_len <= $max_note_packed_len, f"{note_type_name} has a packed length of {note_packed_len} fields, which exceeds the maximum allowed length of {max_note_packed_len} fields");
std::static_assert(note_packed_len <= $max_note_packed_len, f"{note_type_name} has a packed length of {note_packed_len} fields, which exceeds the maximum allowed length of {max_note_packed_len} fields. See https://docs.aztec.network/errors/4");
0 commit comments