Skip to main content

Search

Items tagged with: rust


I built a temperature logger for the raised bed in my garden with a #RaspberryPi and #Rust.
A raised bed with a water-proof plastic box mounted on the outside of its wooden frame, and some cables coming out of the plastic box. The cable of a temperature sensor coming out of the earth inside the raised bed
A plot showing temperature curves for air and earth temperatures The raised bed with several cables leading to different temperature sensors


A #Lemmy client called #Lemmur is finally available on F-Droid. Lemmy is a free software federated alternative to #Reddit written in #Rust. https://lemmy.ml/post/53632


that is about coding in rust, not about the code quality written in rust.

sidenote:
fn main() {
let a = 123u8;
let b:i32 = a as i32;
println!("a={:#?} b={:#?}", a, b);
}
But it only shows that you've grown up on non-typed languages. I started on Pascal back then and I always favoured strongly typed ones so #Rust looks pretty sexy to me. YMMV.
#rust


Hi !

How can I convert an "i32" variable to an enum value in #rust ? :rust:

The "cast" will be in the expression of a match.

I have seen some things about deriving "TryFrom" or "FromPrimitive" traits, but I'm not sure that's up to date.

I believe it's possible, but... how ?

Please, if you know how it works, tell me. x)
#rust