Skip to content

Commit 59d8898

Browse files
committed
traits.md: Fix example of using traits to match description
traits.md said: If we add a `use` line right above `main` and make the right things public, everything is fine: However, the use line was actually placed at the top of the file instead. Move the use line to right above main. That also makes the example more evocative of cases where the module is defined in a separate file.
1 parent cf51e55 commit 59d8898

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/doc/trpl/traits.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,6 @@ everything is fine:
229229

230230
```{rust}
231231
# #![feature(core)]
232-
use shapes::HasArea;
233-
234232
mod shapes {
235233
use std::f64::consts;
236234
@@ -251,6 +249,7 @@ mod shapes {
251249
}
252250
}
253251
252+
use shapes::HasArea;
254253
255254
fn main() {
256255
let c = shapes::Circle {

0 commit comments

Comments
 (0)