Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Variable Name in ownership.md (n should be k) #101

Merged
merged 2 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Berikut merupakan hall of fame kontributor yang sudah berbaik hati menyisihkan w
1. [Opa Kholis Majid](https://github.com/opakholis)
1. [Rian](https://github.com/rian256)
1. [Shandy Siswandi](https://github.com/shandysiswandi)
1. [Taruna Wahyudi](https://github.com/tarunawahyudi)
1. [Theis Andatu](https://github.com/antheiz)
1. ... anda :-)

Expand Down
2 changes: 1 addition & 1 deletion docs/basic/ownership.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Di dalam fungsi `do_something`, variabel `k` dideklarasikan. Statement deklarasi

Kemudian ada block expression, dan di dalamnya terjadi lagi proses alokasi memory untuk data variabel `m` dengan nilai adalah string `hello world`, dan variabel `n` berisi string `from rust`.

Masih di dalam block expression, terjadi assignment operation, data variabel `n` berpindah ke variabel `k`. Lalu bagaimana nasib data string `hello` yang sebelumnya dimiliki oleh `n`? Yang terjadi adalah data tersebut tidak memiliki reference, dan nantinya di akhir fungsi akan di-dealokasi. Proses dealokasi terjadi setelah fungsi `do_something` selesai dieksekusi karena variable scope data tersebut adalah di block kode fungsi `do_something`.
Masih di dalam block expression, terjadi assignment operation, data variabel `n` berpindah ke variabel `k`. Lalu bagaimana nasib data string `hello` yang sebelumnya dimiliki oleh `k`? Yang terjadi adalah data tersebut tidak memiliki reference, dan nantinya di akhir fungsi akan di-dealokasi. Proses dealokasi terjadi setelah fungsi `do_something` selesai dieksekusi karena variable scope data tersebut adalah di block kode fungsi `do_something`.

Ok, masih dalam block expression. Ada statement print untuk data variable `m` yang merupakan statement terakhir di block expression tersebut. Setelah eksekusi block expression selesai, yang terjadi kemudian adalah:

Expand Down
2 changes: 1 addition & 1 deletion examples
Submodule examples updated 36 files
+6 −0 file_path_directory/Cargo.toml
+141 −0 file_path_directory/src/main.rs
+0 −25 match_4/src/main.rs
+0 −0 module_basic/module_1/Cargo.toml
+0 −0 module_basic/module_1/src/main.rs
+0 −0 module_basic/module_1/src/my_io.rs
+0 −0 module_basic/module_2/Cargo.toml
+0 −0 module_basic/module_2/src/main.rs
+0 −0 module_basic/module_2/src/my_io.rs
+0 −0 module_basic/module_2/src/my_number/mod.rs
+0 −0 module_basic/module_3/Cargo.toml
+0 −0 module_basic/module_3/src/main.rs
+0 −0 module_basic/module_3/src/my_io.rs
+0 −0 module_basic/module_3/src/my_number/conversion_utility/mod.rs
+0 −0 module_basic/module_3/src/my_number/mod.rs
+0 −0 module_basic/module_4/Cargo.toml
+0 −0 module_basic/module_4/src/main.rs
+0 −0 module_basic/module_4/src/my_io.rs
+0 −0 module_basic/module_4/src/my_number/conversion.rs
+0 −0 module_basic/module_4/src/my_number/mod.rs
+6 −0 operator_tanda_tanya/operator_tanda_tanya_1/Cargo.toml
+32 −0 operator_tanda_tanya/operator_tanda_tanya_1/src/main.rs
+6 −0 operator_tanda_tanya/operator_tanda_tanya_2/Cargo.toml
+25 −0 operator_tanda_tanya/operator_tanda_tanya_2/src/main.rs
+6 −0 operator_tanda_tanya/operator_tanda_tanya_3/Cargo.toml
+28 −0 operator_tanda_tanya/operator_tanda_tanya_3/src/main.rs
+6 −0 recoverable_error_handling/Cargo.toml
+20 −0 recoverable_error_handling/src/file_action_constant.rs
+150 −0 recoverable_error_handling/src/file_manager.rs
+26 −0 recoverable_error_handling/src/file_utility.rs
+75 −0 recoverable_error_handling/src/main.rs
+19 −0 result_type/src/main.rs
+6 −0 unrecoverable_panic_error/unrecoverable_panic_error_1/Cargo.toml
+8 −0 unrecoverable_panic_error/unrecoverable_panic_error_1/src/main.rs
+2 −1 unrecoverable_panic_error/unrecoverable_panic_error_2/Cargo.toml
+25 −0 unrecoverable_panic_error/unrecoverable_panic_error_2/src/main.rs
Loading