CyberCode Academy

Course 19 - Ultimate Rust Crash Course | Episode 2: Rust Core Foundations: Data Types, Control Flow, and String Handling


Listen Later

In this lesson, you’ll learn about:
  • Core Data Representations in Rust:
    • Scalar types: integers (signed i and unsigned u), floating-point types (f32, f64), booleans, and Unicode char values.
    • Compound types: tuples (accessed via indexing or destructuring) and fixed-size arrays stored on the stack, along with their practical limits.
  • Project Organization and Reusability:
    • Moving logic into a library file (lib.rs).
    • Exposing functions with the pub keyword and importing them using use statements.
  • Control Flow and Program Logic:
    • Using if as an expression that returns a value, replacing traditional ternary operators.
    • Working with loops: loop (including labeled breaks), while, and for.
    • Iterating with ranges, both exclusive (0..50) and inclusive (0..=50).
  • Understanding Rust Strings:
    • Differences between borrowed string slices (&str) and owned, heap-allocated String types.
    • Why UTF-8 encoding prevents direct character indexing.
    • Safely accessing string data using iterators like .bytes(), .chars(), and .nth().
  • Practical Application:
    • Processing command-line arguments as vectors of strings.
    • Applying loops and conditional logic to perform numeric operations such as summing ranges or repeatedly modifying values until a condition is met.


You can listen and download our episodes for free on more than 10 different platforms:
https://linktr.ee/cybercode_academy
...more
View all episodesView all episodes
Download on the App Store

CyberCode AcademyBy CyberCode Academy