Skip to content
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

String interpolation not covered yet in unwrap exercise #182

Closed
louwers opened this issue Oct 20, 2024 · 1 comment
Closed

String interpolation not covered yet in unwrap exercise #182

louwers opened this issue Oct 20, 2024 · 1 comment

Comments

@louwers
Copy link

louwers commented Oct 20, 2024

For the Unwrap exercise string interpolation is needed.

Correct me if I'm wrong, but I don't think it's covered at that point.

@LukeMathWalker
Copy link
Collaborator

It is indeed correct.

At the same time, the naive panic!(err) attempt will lead to a compiler error that will spit out the correct solution:

error: format argument must be a string literal
 --> src/main.rs:3:12
  |
3 |     panic!(error);
  |            ^
  |
help: you might be missing a string literal to format with
  |
3 |     panic!("{}", error);
  |            +++++

Since we explicitly talk about interpolation two exercises down the line, I think it's a fine balance to strike.

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

No branches or pull requests

2 participants