Skip to content

Commit 21b36bc

Browse files
authoredJun 11, 2021
Add comments on "borrowing" in Rust
1 parent 61bea43 commit 21b36bc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎RUST.md

+12
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,17 @@ so &mut isn't needed that often.
3131
Passing by reference is important when we have a large object and don't wish to copy it.
3232
```
3333

34+
```
35+
A C programmer pronounces & as 'address of'; a Rust programmer pronounces it 'borrow'.
36+
This is going to be the key word when learning Rust.
37+
```
38+
39+
```
40+
Borrowing is the name given to a common pattern in programming
41+
; whenever you pass something by reference (as nearly always happens in dynamic languages) or pass a pointer in C.
42+
43+
Anything borrowed remains owned by the original owner.
44+
```
45+
3446
## References
3547
- [Rust: Gentle Intro](https://stevedonovan.github.io/rust-gentle-intro/)

0 commit comments

Comments
 (0)
Please sign in to comment.