mut
keyword is needed for a variable to be mutable.- Match expression returns a value.
println!
macro is used for output.vec!
is used to create vector.- Debug placeholder
{:?}
to be replaced by whichever type. - Variable is owned by functions, and cleaned up when its owning function ends. Ownership is passed when it is called by another funciton.
- To not pass ownership,
&
is used to denote borrowing. Result
type can hold a value or a error. A value isunwrap()
from the returnedResult
.
-
Notifications
You must be signed in to change notification settings - Fork 0
liuyinglao/rust-example
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Rust Learning Notes
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published