You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
will throw an error stating "cannot borrow library as mutable, as it is not declared as mutable". Adding mut to the library declaration seems to make it compile, though my impression was that we should not have to change the code in main. Or, perhaps there is something I am overlooking here? I am using rustc version 1.66.0.
The text was updated successfully, but these errors were encountered:
Adding mut to the library declaration seems to make it compile, though my impression was that we should not have to change the code in main
That is indeed what you need to do to solve this exercise 😄 There are actually solutions for most exercises — though they're not linked from the exercise page itself to avoid spoiling it for people.
Would it help if we move up the comment found in main? Right now it says
fn main(){// This shows the desired behavior. Uncomment the code below and// implement the missing methods. You will need to update the// method signatures, including the "self" parameter!let library = Library::new();
We could move the part about updating the method signatures to just below impl Library.
Would you be up for sending a PR wih that change? Please add Fixes: #99 to the commit message if you do so that this issue can be auto-closed.
Hi I was having an issue with the exercise at the end of day 1. Writing it as it is shown in the solution
will throw an error stating "cannot borrow
library
as mutable, as it is not declared as mutable". Adding mut to the library declaration seems to make it compile, though my impression was that we should not have to change the code in main. Or, perhaps there is something I am overlooking here? I am using rustc version 1.66.0.The text was updated successfully, but these errors were encountered: