|
|
|
|
|
by MichaelGG
3625 days ago
|
|
Actually, this suggestion does not even work. Writing trait::method is not equivalent to writing "|x|x.method()". The latter will use method lookup rules, the former requires the programmer to decide which impl. For instance, in the above example, if the type impl'd to_string, that would be the one used, not ToString's implementation. From what I can tell anyways: https://is.gd/E8pdWc Edit: Also, auto-borrow does not seem to work with this syntax. This is a common enough pattern that reducing the visual noise will increase clarity. |
|