Earlier quoted context omitted.
Even without if let or match many of those unwraps are unnecessary. See https://github.com/zookini/aoc-2020/blob/master/src/bin/2.rs
Interesting! Can you help me understand why this doesn't work for me? error[E0599]: no method named `parse` found for enum `Option >` in the current scope --> src\main.rs:24:39 | 24 | min: caps.name("min").parse().unwrap(), | ^^^^^ method not found in `Option >`
A half-hour to learn Rust
311–320 of 342 posts
Re: A half-hour to learn Rust
#312Re: A half-hour to learn Rust
#313New to Rust, was excited to see Prolog anonymous variables make an appearance. But one thing struck me is the mismatch between variable and function declarations... let x: i32 = 42; vs fn fair_dice_roll() -> i32 { 4 } It seems the designers missed an opportunity, as the latter could quite easily have been: fn fair_dice_roll() : i32 = 4; or fn fair_dice_roll() : i32 = { ... code that produces 4... } at the slight expe…
I personally like the arrow being used for return types as it highlights pretty well what returns stuff. I don't need to track fn definitions or anything when scanning a file - I just need to look for the arrows.
Re: A half-hour to learn Rust
#314Re: A half-hour to learn Rust
#315Earlier quoted context omitted.
The assumption that real-world use had not been tried.
An hour isn’t enough to use it on real world use, am I not right?
That may not be what you meant but it seems like that’s what people are understanding.
Re: A half-hour to learn Rust
#316I assume Rust doesn’t yet have a comparable library like pythons pipy yet? Ie everything imaginable covered.
crates.io has 52,000 crates. You may not find everything, but you can find a lot of things.
>A rust device driver for the Bosch BME280 temperature, humidity, and atmospheric pressure sensor and the Bosch BMP280 temperature, and atmospheric pressure sensor
Re: A half-hour to learn Rust
#317Earlier quoted context omitted.
> I cannot believe that I am smitten by Rust within an hour This has been my, and a lot of my colleagues', experience with Rust. Never have I seen people fall in love with a programming language so strongly. And the love lasts for a long time.
Try to use that in real world and see if your love still stays put. An hour is not enough to validate Rust.
Re: A half-hour to learn Rust
#318Earlier quoted context omitted.
Try to use that in real world and see if your love still stays put. An hour is not enough to validate Rust.
Typical condescending HN response. We are using Rust, we've used it to build and ship a successful native desktop app.
Re: A half-hour to learn Rust
#319Earlier quoted context omitted.
The assumption that real-world use had not been tried.
An hour isn’t enough to use it on real world use, am I not right?
This suggests experience far more than a single hour, does it not?
Re: A half-hour to learn Rust
#320A half-hour to learn Rust Jan 27, 2020 · 51 minute read · rust maybe the site's reading time estimator is broken? sarcasm intended. But seriously, it is good to have people writing things like this.
I'm guessing the code snippets are skewing the estimate.