Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels