Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. pub trait Summary {
  2. fn summarize(&self) -> String {
  3. String::from("(Read more...)")
  4. }
  5. }
  6.  
  7. struct Book;
  8.  
  9. impl Summary for Book{}
  10.  
  11. fn main() {
  12.  
  13. let book = Book{};
  14. println!("Book Summary {}", book.summarize());
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement