You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't really a bug, but both my partner and I learning Rust felt that 5.14 was a beast! I had to cheat and look at the solution. My partner used an LLM and got an answer very much unlike what we had learned to date.
I was confused by something I saw in the solution brand. The example for how to use #from in 5.14 reads as follows:
#[derive(Error, Debug)]
pub enum MyError {
#[error("Failed to connect to the database")]
DatabaseError {
#[from]
inner: std::io::Error
}
}
Note that the syntax in the example uses the structure form of associating data with the enum
But in the solution, Database Error uses parens
This isn't really a bug, but both my partner and I learning Rust felt that 5.14 was a beast! I had to cheat and look at the solution. My partner used an LLM and got an answer very much unlike what we had learned to date.
I was confused by something I saw in the solution brand. The example for how to use #from in 5.14 reads as follows:
Note that the syntax in the example uses the structure form of associating data with the enum
But in the solution, Database Error uses parens
Tuples or tuple like syntax is covered in the Nullability lesson 5.5 , but never used in an exercise before this one. Tricky!
The text was updated successfully, but these errors were encountered: