Skip to content

Commit 73841a6

Browse files
committed
Accessors.rst: Feedback from @gregtitus and @rjmccall
2 parents f7353a7 + ddf916e commit 73841a6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/proposals/Accessors.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ while a slice is being mutated to grant permission for the slice
559559
to mutate the collection in-place while sharing ownership. This
560560
flexibility can be exposed by a pair of accessors that are called
561561
before and after a mutation. The "get" stage produces both the
562-
value to mutate, and a state value (whose type must be declared) to
562+
value to mutate and a state value (whose type must be declared) to
563563
forward to the "set" stage. A pinning accessor can then look something
564564
like this::
565565

@@ -585,7 +585,8 @@ like this::
585585
}
586586

587587
``getForMutation`` and ``setForMutation`` must appear as a pair;
588-
neither one is valid on its own.
588+
neither one is valid on its own. A ``get`` and ``set`` accessor
589+
should also still be provided for simple read and write operations.
589590
When the compiler has visibility that storage is implemented in
590591
terms of ``getForMutation`` and ``setForMutation``, it lowers a mutable
591592
projection using those accessors as follows::

0 commit comments

Comments
 (0)