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

> Use impl types as arguments rather than generic constraints when you can

Eep. No. At least, not in anything public. Universal impl trait arguments can't be turbofished, so you're placing an unnecessary constraint on your caller.



As I understand it &impl Meower also uses dynamic dispatch, whereas the generic version will generate a specialized version for each concrete type it is called with.


Are you sure? I thought that was dyn Meower.


You’re right! My bad


> Universal impl trait arguments can't be turbofished, so you're placing an unnecessary constraint on your caller.

What does this mean?




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: