From c741923a73818f3054b66ce3cf7d58ab8d9ce9be Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Mon, 4 Sep 2023 17:30:09 -0300 Subject: [PATCH] Good syntax+Helpful errors examples --- rust-em-10-minutos.html | 84 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/rust-em-10-minutos.html b/rust-em-10-minutos.html index f116884..a81bfbc 100644 --- a/rust-em-10-minutos.html +++ b/rust-em-10-minutos.html @@ -162,6 +162,7 @@

(and lifetimes)

+ Good Syntax

+

+ Helpful Errors

@@ -233,6 +234,8 @@ func foo() {
+

Good Syntax

+

StackOverflow Survey 2023: "Most Admired Language" (84.6%)

@@ -242,6 +245,87 @@ func foo() {

+
+

Helpful Errors

+ +

+fn main() {
+    let a = 2;
+    a = 3;
+    println!("{}", a);
+}
+                    
+ + +
+ +
+

Helpful Errors

+

+3 |     let a = 2;
+  |         -
+  |         |
+  |         first assignment to `a`
+  |         help: make this binding mutable: `mut a`
+4 |     a = 3;
+  |     ^^^^^ cannot assign twice to immutable variable
+                    
+ + +
+ +
+

Helpful Errors

+

+3 |     let a = 2;
+  |         -
+  |         |
+  |         first assignment to `a`
+  |         help: make this binding mutable: `mut a`
+4 |     a = 3;
+  |     ^^^^^ cannot assign twice to immutable variable
+                    
+ + +
+ +
+

Helpful Errors

+

+3 |     let a = 2;
+  |         -
+  |         |
+  |         first assignment to `a`
+  |         help: make this binding mutable: `mut a`
+4 |     a = 3;
+  |     ^^^^^ cannot assign twice to immutable variable
+                    
+ + +
+