Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/exercises/day-1/book-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Use this to create a library application. Copy the code below to
<https://play.rust-lang.org/> and update the types to make it compile:

```rust,should_panic
// TODO: remove this when you're done with your implementation.
#![allow(unused_variables, dead_code)]

{{#include book-library.rs:setup}}

Expand Down
9 changes: 7 additions & 2 deletions src/exercises/day-1/book-library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ fn main() {
let library = Library::new();

//println!("Our library is empty: {}", library.is_empty());
//
//library.add_book(Book::new("Lord of the Rings", 1954));

let favorite_book = Book::new("Lord of the Rings", 1954);
println!("Our favorite book {favorite_book} should go in the library");
//library.add_book(favorite_book);
//library.add_book(Book::new("Alice's Adventures in Wonderland", 1865));
//
//library.print_books();
Expand All @@ -116,6 +118,9 @@ fn main() {
//}
//
//println!("Our library has {} books", library.len());
for book in library.books {
println!("{book}");
}
Comment on lines +121 to +123
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that this inadvertently shows the students what they are supposed to write in the print_books method. I'll fix this for the class I'm teaching next week.

}
// ANCHOR_END: main

Expand Down