about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2015-04-06 08:14:11 -0700
committerJosh Triplett <josh@joshtriplett.org>2015-04-06 08:14:11 -0700
commit59d889805e7303e862d02f22aba0887ce49975e7 (patch)
tree9051427b9ecc8686925e00e813744f48f2a211d9
parentcf51e55274d6f2eabaf04ff2fc7a6cd61180a0ac (diff)
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.
-rw-r--r--src/doc/trpl/traits.md3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/doc/trpl/traits.md b/src/doc/trpl/traits.md
index 341c90a7087..2986de4179b 100644
--- a/src/doc/trpl/traits.md
+++ b/src/doc/trpl/traits.md
@@ -229,8 +229,6 @@ everything is fine:
 
 ```{rust}
 # #![feature(core)]
-use shapes::HasArea;
-
 mod shapes {
     use std::f64::consts;
 
@@ -251,6 +249,7 @@ mod shapes {
     }
 }
 
+use shapes::HasArea;
 
 fn main() {
     let c = shapes::Circle {