Search
Items tagged with: rust
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.
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.
Hi !
How can I convert an "i32" variable to an enum value in #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)
How can I convert an "i32" variable to an enum value in #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)