##### Documentation

0 ↪️ rustlabs

1 ↪️ Why Rust?

2 ↪️ hello world program

3 ↪️ The Basic Formatting

4 ↪️ Printing Styles

5 ↪️ comments

6 ↪️ Challenge 1 - Display Output

7 ↪️ solution 1 - display output

8 ↪️ challenge 2 - display output using placeholders

9 ↪️ solution 2 - display output using placeholders

10 ↪️ What Are Variables?

11 ↪️ scope and shadowing

12 ↪️ challenge - defining variables

13 ↪️ Solution - Defining Variables

14 ↪️ what are data types?

15 ↪️ Numeric Types - Integers and Floats

16 ↪️ boolean

17 ↪️ Character and String

18 ↪️ Array

19 ↪️ Tuples

20 ↪️ Constant Variable

21 ↪️ Challenge 1 - Declare an Array

22 ↪️ Solution-1-Declare an Array

23 ↪️ Challenge 2 declare a Tuple

24 ↪️ Solution 2 - Declare a Tuple

25 ↪️ Introduction to Operators

26 ↪️ Arithmetic Operators

27 ↪️ Logical Operators

28 ↪️ Comparison Operators

29 ↪️ Bitwise Operators

30 ↪️ Assignment and Compound Assignment Operators

31 ↪️ Type Casting Operator

32 ↪️ Borrowing and Dereferencing Operators

33 ↪️ Precedence and Associativity

34 ↪️ Challenge - Calculate (a + b)^3

35 ↪️ Solution - Calculate (a + b)^3

36 ↪️ If Expression

37 ↪️ If let Expression

38 ↪️ Match Expression

39 ↪️ Comparison of The Different Conditional Constructs

40 ↪️ Challenge 1 - Check If Even or Odd

41 ↪️ Solution 1 - Check If Even or Odd

42 ↪️ Challenge 2 - Make a Calculator

43 ↪️ Solution 2 - Make a Calculator

44 ↪️ what is a loop ?

45 ↪️ Definite Loop - For Loop

46 ↪️ Indefinite Loop - While and Loop

47 ↪️ Break Statement

48 ↪️ Continue Statement

49 ↪️ Nested Loops

50 ↪️ Loop Labels

51 ↪️ Challenge 1 - Find The Factorial

52 ↪️ Solution 1 - Find The Factorial

53 ↪️ Challenge 2 - Count Iterations of a Loop Until a Condition

54 ↪️ Solution 2 - Count Iterations of a Loop Until a Condition

55 ↪️ Challenge 3 - Print a Right-Angled Triangle

56 ↪️ Solution 3 - Print a Right-Angled Triangle

57 ↪️ Introduction to Functions

58 ↪️ Functions With Parameters

59 ↪️ Pass by Value

60 ↪️ Pass by Reference

61 ↪️ Returning a Value From a Function

62 ↪️ Function With Multiple Return Values

63 ↪️ Function With Arrays as Arguments

64 ↪️ Challenge 1 - Check Divisibility by 3 and 4

65 ↪️ Solution 1 - Check Divisibility by 3 and 4

66 ↪️ Challenge 2 - Return an Array of Squares

67 ↪️ Solution 2- Return an Array of Squares

68 ↪️ What Is Recursion?

69 ↪️ Challenge 3 - Find nth Fibonacci Number

70 ↪️ Solution 3 - Find nth Fibonacci Number

71 ↪️ Introduction to Strings

72 ↪️ Core Methods of String Objects

73 ↪️ Iterating Over Strings

74 ↪️ Updating a String

75 ↪️ Slicing a String

76 ↪️ Functions and Strings

77 ↪️ Challenge - Concatenate Words Starting With 'c'

78 ↪️ solution - Concatenate Words Starting With 'c'

79 ↪️ Introduction to Vectors

80 ↪️ Iterating Over a Vector

81 ↪️ Slicing a Vector

82 ↪️ Challenge - Resizing a Vector

83 ↪️ Solution - Resizing a Vector

84 ↪️ Introduction to Structs

85 ↪️ Functions and Structs

86 ↪️ Methods of Structs

87 ↪️ Static Methods of Structs

88 ↪️ Tuple Structs

89 ↪️ Challenge - Calculate Distance Between Two Points

90 ↪️ Soluation - Calculate Distance Between Two Points

91 ↪️ Introduction to Enums

92 ↪️ Enums With Data Type

93 ↪️ Methods of Enums

94 ↪️ Enums and Match Control Flow Operator

95 ↪️ Enums and Structures

96 ↪️ What Is Option?

97 ↪️ Result and Enum

98 ↪️ Challenge - Find If the Day Is a Weekend

99 ↪️ Solution - Find If the Day Is a Weekend

100 ↪️ Traits

101 ↪️ Generics

102 ↪️ Challenge- Check If the Person Has a Driving License

103 ↪️ Solution - Check If the Person Has a Driving License

104 ↪️ Introduction to Modules

105 ↪️ Controlling Visibility Within the Same File Using 'pub'

106 ↪️ Control Visibility Within Different Files Using 'pub'

107 ↪️ The 'use' Keyword

108 ↪️ Challenge - Find the Area of a Triangle

109 ↪️ Solution - Find the Area of a Triangle

110 ↪️ Memory Management

111 ↪️ Ownership

112 ↪️ Copy Type and Moved Type

113 ↪️ Ownership and Functions

114 ↪️ Borrowing

115 ↪️ lifetimes

116 ↪️ lifetimes Elision

# Why Rust?

What makes Rust important?

- Why Is Rust Different?

- Speed

- Safety

- Cargo Manager

- Error Messages

- Efficient C Binding

- Threads without Data Races

# Why Is Rust Different?

There are many reasons why Rust is different from other programming languages.

# Speed

Rust pays no penalty for the abstraction and only pays for the features that are actually used. This improves the code quality and readability without affecting the run time cost.

# Safety

Rust does not have a garbage collector. It ensures memory safety using ownership and its borrowing concept The most significant difference between C, C++, and Rust is writing safe code. In Rust, the objects are managed by the programming language from the beginning to the end. The proper amount of memory required is allocated and automatically deallocated by the system when it is no longer in use.

# Cargo Manager

System languages like C and C++ never had a standard package manager. Rust provides a cargo manager that has all the rust libraries and frameworks to not only help developers make fantastic applications, but also distribute code to end-users.

# Error Messages

The error messages in Rust are displayed using color. Formatting and misspellings in the program are commonly suggested. It not only displays the line which has the error but, also the type of error.

# Efficient C Binding

The Rust language can interoperate with the C language. It provides a foreign function interface to communicate with C API’s. Due to its ownership rules, it can guarantee memory safety.

# Threads without Data Races

Data race is a condition where two or more threads can access the same memory location. Rust uses the concept of ownership to avoid data races.