In this lesson, we will talk about Structs in Rust
What are Structs?
Structs are a way to create more complex data types.
They are si...
For further actions, you may consider blocking this person and/or reporting abuse
prefer this syntax to golang, content here is very useful, its a shame that the code blocks are not formatted for clarity
struct MyStruct {
name:String,
}
it should be fixed now, thanks
Instances from other instances example is not really good! User.email is moved to new_user and if you try to use it the compiler gets engry 😃
There are different ways to avoid this (I explain it in the video but I didn't want to make the article too long). you can either clone() the single propery or even clone the whole instance adding the clone trait to the struct