提交 e68697b5 编写于 作者: G gifnksm

tutorial: Remove the sentence about mutable fields.

上级 9aab7e59
...@@ -1089,10 +1089,8 @@ we might like to compute the distance between `on_the_stack` and ...@@ -1089,10 +1089,8 @@ we might like to compute the distance between `on_the_stack` and
to define a function that takes two arguments of type point—that is, to define a function that takes two arguments of type point—that is,
it takes the points by value. But this will cause the points to be it takes the points by value. But this will cause the points to be
copied when we call the function. For points, this is probably not so copied when we call the function. For points, this is probably not so
bad, but often copies are expensive or, worse, if copied data are in mutable bad, but often copies are expensive. So we’d like to define a function
slots, they can change the semantics of your program. So we’d like to that takes the points by pointer. We can use borrowed pointers to do this:
define a function that takes the points by pointer. We can use
borrowed pointers to do this:
~~~ ~~~
# struct Point { x: float, y: float } # struct Point { x: float, y: float }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册