docs: improve styleguide #1044

Open
opened 2023-10-01 22:58:45 +00:00 by emidoots · 0 comments
emidoots commented 2023-10-01 22:58:45 +00:00 (Migrated from github.com)
  • Prefer Unmanaged variants of things, e.g. ArrayListUnmanaged over ArrayList.
  • Heap allocation should be done by the caller, e.g. pub fn init should not return heap allocated objects but the caller may choose to do so. - in order to keep allocations obvious to the caller.
  • When single-line for loops are small, write them inline instead of using braces.

Ref https://github.com/hexops/mach-dusk/pull/85

* Prefer `Unmanaged` variants of things, e.g. `ArrayListUnmanaged` over `ArrayList`. * Heap allocation should be done by the caller, e.g. `pub fn init` should not return heap allocated objects but the caller may choose to do so. - in order to keep allocations obvious to the caller. * When single-line for loops are small, write them inline instead of using braces. Ref https://github.com/hexops/mach-dusk/pull/85
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach#1044
No description provided.