Skip to content

Commit d9281b8

Browse files
committed
Remove old smaller code example and group all prose
1 parent 71d16eb commit d9281b8

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/items/implementations.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ The [path] to an associated item is: any path to the implementing type,
5959
followed by the path to the associate item within the inherent
6060
implementation.
6161

62+
A type can also have multiple inherent implementations. An implementing type
63+
must be defined within the same crate as the original type definition.
64+
6265
``` rust
6366
pub mod color {
6467
pub struct Color(pub u8, pub u8, pub u8);
@@ -86,22 +89,6 @@ fn main() {
8689
}
8790
```
8891

89-
A type can also have multiple inherent implementations. An implementing type
90-
must be defined within the same crate as the original type definition.
91-
92-
```rust
93-
struct Point {x: i32, y: i32}
94-
95-
impl Point {
96-
fn log(&self) {
97-
println!("Point is at ({}, {})", self.x, self.y);
98-
}
99-
}
100-
101-
let my_point = Point {x: 10, y:11};
102-
my_point.log();
103-
```
104-
10592
## Trait Implementations
10693

10794
A _trait implementation_ is defined like an inherent implementation except that

0 commit comments

Comments
 (0)