diff --git a/porque-rust.html b/porque-rust.html index 2de1e42..aa23575 100644 --- a/porque-rust.html +++ b/porque-rust.html @@ -251,7 +251,7 @@ let a = String::from("hello");
fn main() {
let a = String::from("hello");
- let _b = a;
+ let b = a;
println!("{}", a)
}
@@ -262,8 +262,8 @@ fn main() {
error[E0382]: borrow of moved value: `a`
--> src/main.rs:5:20
|
-4 | let _b = a;
- | - value moved here
+4 | let b = a;
+ | - value moved here
5 | println!("{}", a)
| ^ value borrowed here after move
|
@@ -274,9 +274,9 @@ error[E0382]: borrow of moved value: `a`
@@ -293,7 +293,7 @@ error[E0382]: borrow of moved value: `a`
fn main() {
let a = String::from("hello");
- let _b = &a;
+ let b = &a;
println!("{}", a)
}
@@ -335,14 +335,6 @@ fn main() {
-
-pub fn drop<T>(_x: T) { }
-
- - - A linguagem mais amada segundo o StackOverflow - Survey 2022 + + A linguagem mais amada (admirada) segundo o + StackOverflow Survey 2023
-... pelo 7⁰ ano seguido.
+... pelo 8⁰ ano seguido.
-match File::create("something.txt") {
- Ok(fp) => fp.write_all(b"Hello world"),
- Err(err) => println!("Failure! {}", err),
-}
+
+FILE* fp = fopen("something.txt");
+fprintf(fp, "Hello world");
match File::create("something.txt") {
- Ok(fp) => match fp.write_all(b"Hello world") {
- Ok(_) => (),
- Err(err) => println!("Can't write! {}", err),
- }
+ Ok(fp) => fp.write_all(b"Hello world"),
Err(err) => println!("Failure! {}", err),
}