From 59d889805e7303e862d02f22aba0887ce49975e7 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Mon, 6 Apr 2015 08:14:11 -0700 Subject: [PATCH] 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. --- src/doc/trpl/traits.md | 3 +-- 1 file changed, 1 insertion(+), 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 {