Learning Rust
Table of content
Why Rust?
Like many before me, I have gained interest in the rust programming language. My main interest comes from the fact that it can be used for embedded programming. There is a lot of activity on the topic, see Embedded Rust for more information. Before I feel comfortable diving into this world, I want to learn the basics.
100 day Challenge
That is why I’m starting a 100 day 100 snippet challenge in rust, to motivate myself. Rules of this are:
- 1 unique code snippet per day for 100 days
- Come up with a challenge
- Solve the challenge
- Upload and present
- ???
- Profit
First challenge
Challenge
Screen scrape a random recipe name from chefkoch.de
and display its name on the terminal
From the site random recipes are displayed, so what I must do is
Lets test with bash, what needs to be done to screen scrape the right stuff
Will give us a menu suggestion
Gefuellte Muschelnudeln
Do this in rust.
Solution
First we need to download the web page reqwest
crate seems suitable for this job. Next the document is parsed with select
and filtered.
Next question, where can I have live demos of my code? For now I’ll upload it to my github page, see