-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Remove silenced warnings in string-iterators exercise #392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Please move this to the PR title. The title shows up prominently in the history afterwards so it's helpful when it says more than just "Update foo.md" 🙂 Also, please explain why you make the change. What did you see before and after this PR? That gives me a lot more context as a reviewer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing this makes us lose the coupling with the solution in strings-iterators.rs. So I suggest you put the include back to keep the link.
| #![allow(unused_variables, dead_code)] | ||
|
|
||
| {{#include strings-iterators.rs:prefix_matches}} | ||
| pub fn prefix_matches(prefix: &str, request_path: &str) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing this makes us lose the coupling with the function signature in strings-iterators.rs. Could you put the include back so that we can keep the connection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, does it make sense to add a new function to the original string-iterators.rs file and refer to it in this file or just add the line back in as is? The commit I just made does the former.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latter is better: that way we avoid duplication in the solution file and we avoid showing prefix_matches_unimplemented to the students (there is no reason for them to see such a function name).
My goal is to reuse as much as possible from the solution file. We compile the code there in CI so we know it works — when we reuse it, we also have some confidence that the unsolved version is aligned with the solution.
This code had variables in the function arguments that were not being used (yet).
To address that, in this PR I use the function arguments in a print statement. This changes allow us to remove the line to silence warnings for unused variables #71.
Alternatively, we could comment out the functions. As seen in #389.