/learn-rust-with-examples

Learn about Rust with real examples

Primary LanguageRust

Learn Rust with examples

Learn about Rust with real examples. This repo contains example codes for Rust beginners. The examples provide a better understanding of using Rust features. Here are the list of examples:

1.  Hello rust
2.  Cargo
3.  Variables
4.  Strings
5.  Vector 
6.  Slices
7.  Loops
8.  Functions
9.  Structs
10. Enums    
11. Traits    
12. Closures
13. Typs and Conversions
14. Channels
15. Generic types
16. Generic functions
17. Error handling
18. Macro
.
.
.
.
20. Testing

How to run examples

First you need to compile the rust file into binary, then you can run the executable. Here is an example of doing that -

rustc 05.Vectors/example.rs
./example