Próbuję zwrócić błąd Wynik z &'static str
.Nie można uzyskać wystarczającej informacji o typie dla `_`; Adnotacje typu lub wiążące parametry ogólne wymagane
impl Worker {
fn get_task_by_name(&self, name: String) -> Result<Box<Task>, &'static str> {
Err("Task not found!");
}
}
To wyprowadza się następujący błąd:
src/lib.rs:84:5: 84:8 error: unable to infer enough type information about `_`; type annotations or generic parameter binding required [E0282]
src/lib.rs:84 Err("Task not found!");
^~~
Co może być problemem?