Borrowing Arguments Read-Only
The borrowed default for safe reads.
Why Ownership Matters
When you pass a value to a function, Mojo needs to know who can read or change it. That rule is an ownership convention. 🔑
The Default Is Borrowing
By default an argument is borrowed. The function gets read access to the caller's value but does not take it over.
All lessons in this course
- Borrowing Arguments Read-Only
- Mutating in Place with inout
- Taking Ownership with owned
- The Transfer Operator