提交 be792589 编写于 作者: B bors

auto merge of #5651 : luqmana/rust/incoming, r=thestinger

Change fn() -> &fn().
......@@ -1539,9 +1539,9 @@ for spawning [tasks][tasks].
Rust closures have a convenient subtyping property: you can pass any kind of
closure (as long as the arguments and return types match) to functions
that expect a `fn()`. Thus, when writing a higher-order function that
that expect a `&fn()`. Thus, when writing a higher-order function that
only calls its function argument, and does nothing else with it, you
should almost always declare the type of that argument as `fn()`. That way,
should almost always declare the type of that argument as `&fn()`. That way,
callers may pass any kind of closure.
~~~~
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册