Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rust’s inference is generally a strength. If there's a type-shaped hole to fill, and only one way to fill it, Rust will just do it. So for instance `takes_a_vec(some_iter.collect())` works even though `collect` has a generic return type — being passed to `takes_a_vec` implies it must be a Vec, and so that's what Rust infers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: