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

Exercise 7 main function different from solution #8

Closed
dong-zh opened this issue Oct 26, 2022 · 0 comments · Fixed by #19
Closed

Exercise 7 main function different from solution #8

dong-zh opened this issue Oct 26, 2022 · 0 comments · Fixed by #19

Comments

@dong-zh
Copy link

dong-zh commented Oct 26, 2022

The exercise has a trailing comma in the key values, while the solution does not.

Solution:

fn main() {
    let value = "my_string";
    let my_hashmap = hashmap!(
        "hash" => "map",
        "Key" => value // <- no comma
    );

    print_hashmap(&my_hashmap);
}

Exercise:

fn main() {
    let value = "my_string";
    let my_hashmap = hashmap!(
        "hash" => "map",
        "Key" => value, // <- comma
    );

    print_hashmap(&my_hashmap);
}
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 a pull request may close this issue.

1 participant