1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-27 11:08:45 +02:00
Commit Graph

12 Commits

Author SHA1 Message Date
cc813973b1 Update receiver.md (#661)
* Update receiver.md

Moving the sentence to the third point and requesting an example of `self` vs `mut self`.

* Update src/methods/receiver.md

Improved the tone of the sentence.

Co-authored-by: Martin Geisler <martin@geisler.net>

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-05-23 12:57:38 +00:00
aef4c3ca72 Update example.md (#441) 2023-02-19 04:53:11 +00:00
9510e80165 Update receiver.md (#440) 2023-02-19 04:52:41 +00:00
da666548a7 Update example.md (#230)
Adding the line that you can no longer call `add_lap` after the race is finished.
2023-01-24 15:27:29 +01:00
be2bb2d4c5 Speaker notes for Method example (#203)
* Speaker notes for Method example

* Update example.md
2023-01-23 11:53:33 +00:00
ef119bc0d3 Update receiver.md (#229)
The key takeaway is mutability of receivers and the rules that come with it. It might be a repetition of borrow checker rules, but it is important to know they apply to `self` as to any other variable or argument.
2023-01-23 11:39:38 +00:00
a4bd084e50 Corrected typo on receiver.md
https://dictionary.cambridge.org/it/grammatica/grammatica-britannico/it-s-or-its
2023-01-02 10:04:04 +01:00
8470be86d0 Fix a typo 2022-12-28 18:58:23 +06:00
94cd8bb592 Link to reference on method receiver types 2022-12-28 09:19:19 +01:00
82a2f4c423 Mention that there are other receiver types 2022-12-27 18:16:21 +01:00
3631117446 Makes ownership of self more accurate
It’s entirely possible that a method gives ownership of self to another object, or return `self`. 
For example
```
    fn id(self) -> Self {
        return self;
    }
```
or more realistically 
```
    fn or(self, other) -> Self {
      if (self.isValid()) { return self;}
      return other;
    }
```
2022-12-23 00:16:42 -08:00
c212a473ba Publish Comprehensive Rust 🦀 2022-12-21 16:38:28 +01:00