Guest User

Untitled

a guest
Dec 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. struct Book{
  2. title: String,
  3. }
  4. fn create_book_and_return_it_with_ownership() -> Book{
  5. let book: Book = Book {title: String::from("The Title")};
  6. book
  7. }
  8. fn main() {
  9. let book = create_book_and_return_it_with_ownership();
  10. println!("Book {}", book.title);
  11. }
Add Comment
Please, Sign In to add comment