Created
February 26, 2013 16:25
-
-
Save pnkfelix/5039801 to your computer and use it in GitHub Desktop.
Demo of how to use `mod math { mod mat; }`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % cat math/mat.rs | |
| pub struct Mat4<T> { x:T } | |
| % cat main.rs | |
| // // Don't do this: | |
| // use math::mat::*; | |
| // // Do this: | |
| mod math { mod mat; } | |
| fn main() { | |
| use math::mat::Mat4; | |
| let _m : Mat4<int>; | |
| io::println("Hello World"); | |
| }% | |
| % cat math/mat.rs | |
| pub struct Mat4<T> { x:T } | |
| % cat main.rs | |
| // // Don't do this: | |
| // use math::mat::*; | |
| // // Do this: | |
| mod math { mod mat; } | |
| fn main() { | |
| use math::mat::Mat4; | |
| let _m : Mat4<int>; | |
| io::println("Hello World"); | |
| } | |
| % rustc main.rs | |
| warning: no debug symbols in executable (-arch x86_64) | |
| % ./main | |
| Hello World |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment