SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top