DEV Community

Cover image for Learning Rust: A clean start

Learning Rust: A clean start

Andrew Bone on February 26, 2024

I've decided it's time to learn Rust and in order to keep myself motivated I'm going to keep a record of how the learning is going here. A littl...
Collapse
 
link2twenty profile image
Andrew Bone

the variable keyword also is always let, or at least it is as far as I can tell so far.

I've only done the next lesson after these and have already discovered how wrong I was about this 😅

Collapse
 
ragudos profile image
Aaron • Edited

Awesome! You'd be amazed by the power of traits. Be careful about noisy match statements in error handling though. Try using impl for error types!

For example,

impl From<Error> for MyOwnError {
fn from(err: Error) -> Self {
MyOwnError { message: "oh no! }
}
}

With that, whenever the Error type is returned and we say that the return type of a function when it errors is MyOwnError, the from function will be called.

Good luck!

Collapse
 
thiagomg profile image
Thiago Massari Guedes

I started with Rust by reading rust by example, from their website, but eventually bought a book - it worth the investment.

I am also adding tips that I found interesting as I rewrite my blog system. It was initially in D, but as a learning experience, I ported to Rust using ntex to process web requests - Texted2

It's being a great experience. So far, if it compiles, it runs :)

Collapse
 
champraku profile image
champraku

I also started learning rust, Andrew. I see some commonalities between C and Rust. But, it's my initial opinion.

Currently, I'm following the same book and alongside 30DaysOfRust series by inpyjama.

So far, it is very interesting for to learn and I'm directly coming from C language. Not familiar with anyother language.

Collapse
 
qwuik profile image
Mike

Rust is an amazing lang. I think it has a great future. Currently learning it too, made some simple apps already... Expecially was excited with WebAssembly: it can really speed up things.

Collapse
 
link2twenty profile image
Andrew Bone

That's great! I'm looking forward to trying some WASM stuff too.

Collapse
 
chanh_le profile image
Chanh Le

Hi Andrew
I have also started learning Rust myself.
Looking for your next post and hope that we could help each other on this journey!

Collapse
 
revanthgandhi18 profile image
revanth gandhi

Can I be part of your leaning track ?

Collapse
 
princedede profile image
Tserundede Ejueyitchie

How is the learning journey going?

Collapse
 
link2twenty profile image
Andrew Bone

It's going well so far, I aim to have the next post out on Monday 😊