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
When writing the the return_error function in Chapter 3, the example code doesn't pass a concrete type to the find() method.
This results in the compiler throwing this error:
error[E0282]: type annotations needed
--> src/main.rs:66:41
|
66 | } else if let Some(_invalidId) = r.find() {
| ^^^^ cannot infer type of the type parameter `T` declared on the associated function `find`
|
help: consider specifying the generic argument
|
66 | } else if let Some(_invalidId) = r.find::<T>() {
| +++++
This error can be fixed by adding the return type to .find(): find::<InvalidId>()
I'm not sure if this is due to Warp changing since publication or maybe it is intentional to force us learners to read the Warp documentation.
If it's to force us to read the docs, then it's perfect! I definitely learned something. If this wasn't intentional, it's an easy fix I guess.
The text was updated successfully, but these errors were encountered:
When writing the the
return_error
function in Chapter 3, the example code doesn't pass a concrete type to thefind()
method.This results in the compiler throwing this error:
This error can be fixed by adding the return type to
.find()
:find::<InvalidId>()
I'm not sure if this is due to Warp changing since publication or maybe it is intentional to force us learners to read the Warp documentation.
If it's to force us to read the docs, then it's perfect! I definitely learned something. If this wasn't intentional, it's an easy fix I guess.
The text was updated successfully, but these errors were encountered: