mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 03:33:59 +00:00
Rollup merge of #26140 - steveklabnik:gh25803, r=alexcrichton
As this example got changed, we stopped showing how to return self as the first example, so this text is outdated. Fixes #25803
This commit is contained in:
commit
9bcae312a3
@ -86,8 +86,8 @@ impl Circle {
|
||||
# Chaining method calls
|
||||
|
||||
So, now we know how to call a method, such as `foo.bar()`. But what about our
|
||||
original example, `foo.bar().baz()`? This is called ‘method chaining’, and we
|
||||
can do it by returning `self`.
|
||||
original example, `foo.bar().baz()`? This is called ‘method chaining’. Let’s
|
||||
look at an example:
|
||||
|
||||
```rust
|
||||
struct Circle {
|
||||
|
Loading…
Reference in New Issue
Block a user