mirror of
https://github.com/google/styleguide.git
synced 2026-10-28 08:25:21 +08:00
Automated export from internal guides
PiperOrigin-RevId: 1006046694
This commit is contained in:
1 parent
ac81bb465f
commit
c775c0c2f7
1 file changed
+1
-1
+1
-1
@@ -1252,7 +1252,7 @@ Exceptions:
|
||||
|
||||
Writing and naming getters and setters should follow these guidelines:
|
||||
|
||||
* `foo()` for a getter that returns a `T` by value.
|
||||
* `foo()` for a getter that returns `&T`, or `T` by value if `T: Copy`.
|
||||
* `foo_mut()` for a getter that returns a `&mut T`.
|
||||
* `take_foo()` for a getter that "clears" the value (by setting it to `None`
|
||||
or some other default state) and returns the old value.
|
||||
|
||||
Reference in new issue
Block a user