There are these things called `designator`s
I guess I was right about this
https://twitter.com/alcuadrado/status/1222674708677775360 …
-
-
`Option.expect` has a weird name. On the other hand, `unimplemented!()` is a nice addition to the std lib.
Prikaži ovu nit -
I guess Rust gets way more intuitive once you memorize what's Copy and what's not. Function signatures don't show you if they can be called twice with the same value, like in this snippet.pic.twitter.com/Qr69TjdNxW
Prikaži ovu nit -
`?` for `Option` is very simple to understand, as there's only one possible value for `None`.
Prikaži ovu nit -
TS has this new feature where functions can assert that something has a certain type. Something like: (x : number | undefined) => { assertNotUndefined(x); // Throws if undefined // x is a number here } You can define your own asserts. Does this exist in Rust?
Prikaži ovu nit -
-
`and_then`? Come on! That's a flatmap pretty much everywhere.
Prikaži ovu nit -
`cargo build --release --all` builds every crate you installed. Even if you aren't using them.
Prikaži ovu nit -
`RUST_BACKTRACE=1` works in release builds
Without file names and line numbers
Can I distribute debugging symbols in a separate file? That depends on the OS's object format, right?Prikaži ovu nit -
`Result` without `?`/`try!`
I still like `try!`, but now I get why `?` is better.Prikaži ovu nit -
What's more common, `vec[]` or `vec.get`? Is `vec[]` more performant?
Prikaži ovu nit -
`http://Option.map _or`'s order of arguments is surprising. Is this consistent within Rust? Self answer: There are other `or`s, they take the "negative" case first.
Prikaži ovu nit -
Having `std::error::Error.cause` in the std lib
I can't believe js doesn't have anything like that. It's extremely necessary.Prikaži ovu nit -
-
No `dyn` here? Don't you use that for dynamic dispatch? Don't you need that here? Wait! Guys! I'm starting to get it! The compiler is complaining exactly about this
pic.twitter.com/l0ngogA8Uo
Prikaži ovu nit -
-
Boxing your own kind of generic but application-specific error can be useful, right? `anyhow` does something like this?
@TedMielczarek?Prikaži ovu nit -
`?` as `return Err(From::from(err))` is all I wanted.
Prikaži ovu nit -
I still have to pause for a minute every time I see a `ref`.
Prikaži ovu nit -
It would be so useful to somehow see the type of these chained methods. Does rust-analyzer help with this?pic.twitter.com/z6hFPSB43N
Prikaži ovu nit -
intellij does a better job, but I want the actual types, not the generic.pic.twitter.com/a5aUdUQqsq
Prikaži ovu nit -
Same code. Different type declarations. Completely different results
pic.twitter.com/cXA34r3iiV
Prikaži ovu nit -
s/partition/bipartition/g `partition` is cool though.
Prikaži ovu nit -
I just noticed that `pure` functions don't exist anymore
Prikaži ovu nit -
Can I define my own attributes? Are they available during runtime?
Prikaži ovu nit -
If I move something from the stack into another function, does it mean that I'm passing a pointer to the stack? What's the compilation output of this?pic.twitter.com/YNKL0oTZuv
Prikaži ovu nit -
-
Also, does the struct, which has a Vec, grows IN the stack?
Prikaži ovu nit -
*jumps to the definition* Oh, got it! `Vec` just points to its data. I'm not ready for this `RawVec` and `Unique` rabbit hole
Prikaži ovu nit -
`.collect()` ~= `.into()` Both need type annotations.
Prikaži ovu nit -
Now that I think, a `Vec` is sized. It doesn't actually grow. I think you can't stack-allocate unsized things.
Prikaži ovu nit - Još 50 drugih odgovora
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.


