-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Is the Solution to Quiz 2 correct? #2045
Comments
You are probably doing something wrong because the solutions are checked in the CI to all compile and run correctly. Can you please paste your whole exercise code? |
This is my complete exercise code that yields the above-described error. |
I can't reproduce it. Very weird. I also pasted it into the Rust playground and it ran without any problem: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=50188eeb2b80684521e1c7c73282c239 Are you sure Can you please run Can you please also share a screenshot of the error in Rustlings? |
I just ran the checks in the CI on Apple. All solutions ran without a problem: Can you please create a new project with |
I asked for help on the Rust forum: https://users.rust-lang.org/t/error-only-on-a-specific-target/114552 |
Thanks, I appreciate you taking the time! |
@sibkru since it is clippy that is failing it might be worth including the output of:
and
as well. |
Oh, good idea! It is also worth trying out |
@sibkru Did you find time to try the commands above? :) |
I'm new to Rust, so I might be doing something wrong.
In Quiz 2, I was struggling with the following error:
pub fn transformer(input: Vec<(String, Command)>) -> Vec {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
The solution seems to be to make the Command Enum public.
pub enum Command { Uppercase, Trim, Append(usize), }
I wasn't sure if that was a hack or the correct way, so I looked into the solution, which does not declare the enum as public.
But when I copy and paste the solution and look at the rustlings output, I get the same error message I got with my own code (now also for transformer_iter).
rustlings version: 6.0.1
rustc version: 1.79
cargo version: 1.79
Is the solution incorrect, or am I doing something wrong on my side (probably the latter)?
The text was updated successfully, but these errors were encountered: