Part of the Rust Crash Course: https://www.youtube.com/playlist?list=PL6yRaaP0WPkWRsXJgdnw9lj1vchAaKwfS

Welcome to the Rust Crash Course

In this course, we will be learning Rust from scratch. This course is very fast paced and designed for programmers who already have some experience with another programming language such as Dart or JavaScript or Swift. We will talk about variables, constants, ownership, functions, structures, enumerations, collections such as tuples, vectors, hash-maps and iterators, optionals, error handling, lifetime specifiers, traits, pointers, generics, packages, crates, modules and paths, asynchronous programming and we will also create 2 sample applications using Rust to put all these concepts to use!

In this chapter we will have a look at how functions are written in Rust and also learn about passing arguments to functions!

Timestamps:
00:00 - Functions
00:06 - Functions are blocks of code
00:33 - Simple function
01:57 - Functions don't need a return statement
03:28 - Functions with no return types return unit type
05:24 - Arguments to functions
06:28 - Create a function with an argument
07:48 - Return a string in the function
07:55 - Use the function in main() and print it
09:00 - Functions can be created inline
11:50 - Inline functions can have multiple arguments too
13:36 - Simple inline functions don't need curly brackets
14:34 - Multiple statements in inline functions need curly brackets
16:53 - You can point to a function like you would a variable
17:53 - You can then call your function pointers
18:20 - Functions can be passed as arguments too
20:19 - We will see more examples of functions


If you want to support my work, please consider joining my YouTube channel by pressing the Join button!

Twitter: https://twitter.com/vandadnp
LinkedIn: https://linkedin.com/in/vandadnp

Let's get started!