`cfg` for conditional compilation! Niiiiiiice!
-
-
Ok, I saw the units example. Useful, but hackish af
Prikaži ovu nit -
-
I'm going to read it tomorrow though. I must be the juiciest part of the book, and I'm tired today. Short session today. Thanks everyone for your help
Prikaži ovu nit -
-
RAII in Rust looks real. In C++ you maaay use it. I really like RAII!
Prikaži ovu nit -
I guess this macro invocation `println!("a contains: {}", a);` turns into something that uses `&a`. Otherwise, I'd be moving `a`, right?
Prikaži ovu nit -
-
A newline between "compiling" and the error would be sooo nicepic.twitter.com/DyZbBGCpjb
Prikaži ovu nit -
The owner of a value decides if it's mutable or not, really cool.
Prikaži ovu nit -
-
Wait! wtf is going on here? `&boxed_i32` has two different types?pic.twitter.com/qQ4yB91vBN
Prikaži ovu nit -
If a struct implements `Copy` assigning it to a new variable just copies it, it doesn't move it. Do those structs ever get moved?
Prikaži ovu nit -
If you try to derive `Copy` in a struct that doesn't implement `Clone` you get a compilation error. This is confusing. According to `Clone`'s docs `Copy` is super cheap and can only be derived. But if its derivation uses `Clone` I can make it expensive.
Prikaži ovu nit -
References are a little different than the rest of the language. Things normally get dropped when their scope ends, but references are "dropped" right after their last use.
Prikaži ovu nit -
-
Is there a set of principles that guide the language design?
Prikaži ovu nit -
`'static` > every other lifetime. Is `>` to compare lifetimes? They don't have an order, so probably not.
Prikaži ovu nit -
-
"any reference being returned must have the same lifetime as an input or be `static`" Why?
Prikaži ovu nit -
Oh, I think that means that a function can return a reference to its inputs, or to parts of them. If you were to allocate something in a function, you return it by value, right?
Prikaži ovu nit -
Returning by value: copy if `Copy`-able, move otherwise.
Prikaži ovu nit -
Every field of a `struct` can have its own lifetime, if they are references.
Prikaži ovu nit -
Can I bound lifetime params? Something like `'a : not('static)`
Prikaži ovu nit -
-
-
So ellision is just pattern matching of common things. I thought it was going to be something really complex. I'm lucky it's not.
Prikaži ovu nit -
-
-
-
`Clone`'s docs are somewhat misleading. `Clone` === Type that can be duplicated. `Copy` === Type that can be duplicated (i.e. it must be `Clone`), and it can be done with `memcpy`. That's why duplicating `Copy`s is cheap.
Prikaži ovu nit - Još 121 odgovor
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.


See you tomorrow 
