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
appears an awful lot throughout the code. We could make the code prettier by having a helper function which hides having to type these lines again and again. If we want to go to the next beauty level, we could implement the GenerateResponse trait for a Result, like this:
This basically says that if both the Ok and the Err parts of a Result implement GenerateResponse, then the Result itself implements GenerateResponse, so we can send the Result variable through the channel without extracting the actual inner value first.
The text was updated successfully, but these errors were encountered:
The following piece of code:
appears an awful lot throughout the code. We could make the code prettier by having a helper function which hides having to type these lines again and again. If we want to go to the next beauty level, we could implement the
GenerateResponse
trait for aResult
, like this:This basically says that if both the
Ok
and theErr
parts of aResult
implementGenerateResponse
, then theResult
itself implementsGenerateResponse
, so we can send theResult
variable through the channel without extracting the actual inner value first.The text was updated successfully, but these errors were encountered: