Advertisement
cwchen

[Rust] module alias demo

Aug 23rd, 2017
1,448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.26 KB | None | 0 0
  1. extern crate phrase;
  2.  
  3. use phrase::english::greeting as en_greeting;
  4. use phrase::chinese::greeting as zh_greeting;
  5.  
  6. fn main() {
  7.     assert_eq!("Hello, Michael", en_greeting::hello("Michael"));
  8.     assert_eq!("你好,麥可", zh_greeting::hello("麥可"));
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement