Skip to content

Commit 1615afe

Browse files
committed
Fix failing tutorial test case. Fixes build breakage
1 parent 3dc52da commit 1615afe

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

doc/tutorial.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,19 +2518,17 @@ interface describes types that support an equality operation:
25182518

25192519
~~~~
25202520
iface eq {
2521-
fn equals(other: self) -> bool;
2521+
fn equals(&&other: self) -> bool;
25222522
}
2523-
~~~~
2524-
2525-
In an implementation for type `int`, the `equals` method takes an
2526-
`int` argument:
25272523
2528-
~~~~
25292524
impl of eq for int {
2530-
fn equals(other: int) { other == self }
2525+
fn equals(&&other: int) -> bool { other == self }
25312526
}
25322527
~~~~
25332528

2529+
Notice that `equals` takes an `int` argument, rather than a `self` argument, in
2530+
an implementation for type `int`.
2531+
25342532
## Casting to an interface type
25352533

25362534
The above allows us to define functions that polymorphically act on

0 commit comments

Comments
 (0)