Rust Functions & Match Expressions | Temperature Converter Tutorial | Rust by Examples #4
21views
005:55
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Learn Rust by building a Temperature Converter! In this hands-on tutorial, you'll master:
🌡️ What you'll learn:
• Creating functions with parameters and return types
• Working with floating-point numbers (f64)
• Using match expressions for control flow
• Formatting output with precision
• Real nvim editing workflow
⏱️ Timestamps:
0:00 - Introduction
0:15 - Creating the Project with Cargo
0:41 - Understanding Functions in Rust
1:01 - Writing Conversion Functions in Nvim
1:53 - Floating-Point Numbers (f64)
2:08 - Adding User Input with stdin
3:05 - Match Expressions Explained
3:20 - Implementing Bidirectional Conversion
4:25 - Running the Complete Program
5:14 - Recap & What's Next
5:35 - Thanks for Watching
📚 Rust by Examples Series:
This is Lesson 4 of our "Rust by Examples" series where we learn Rust by building real projects. Each lesson builds on the previous one, taking you from beginner to confident Rust developer.
🔗 Resources:
• Rust Book - Functions: https://doc.rust-lang.org/book/ch03-03-how-functions-work.html
• Rust Book - Match: https://doc.rust-lang.org/book/ch06-02-match.html
💻 Code from this lesson:
fn celsius_to_fahrenheit(c: f64) returns f64
c * 9.0 / 5.0 + 32.0
fn fahrenheit_to_celsius(f: f64) returns f64
(f - 32.0) * 5.0 / 9.0
👍 Like and Subscribe for more Rust tutorials!
#Rust #RustLang #Programming #Tutorial #LearnRust #Functions #MatchExpressions #CLI #Nvim