Skip to content

Conversation

@cchiw
Copy link
Collaborator

@cchiw cchiw commented Feb 10, 2023

In book-library.rs we create instances of the structs (library books) so that the struct fields are not unused. These changes allow us to remove the line to silence warnings for unused variables #71.

@qwandor qwandor requested a review from mgeisler February 10, 2023 20:01
@cchiw cchiw changed the title Update book-library.md Remove silenced warnings in book-library exercise Feb 13, 2023
Expanding the variable makes it ever-so-slightly easier to read.
Copy link
Collaborator

@mgeisler mgeisler left a comment

Choose a reason for hiding this comment

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

Thanks!

@cchiw cchiw merged commit c22b35e into main Mar 1, 2023
@cchiw cchiw deleted the cchiw-patch-6 branch March 1, 2023 01:53
Comment on lines +121 to +123
for book in library.books {
println!("{book}");
}
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.

NoahDragon pushed a commit to wnghl/comprehensive-rust that referenced this pull request Jul 19, 2023
* Update book-library.md

* Update book-library.rs

* Apply suggestions from code review

Expanding the variable makes it ever-so-slightly easier to read.

---------

Co-authored-by: Martin Geisler <mgeisler@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants