mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-06 10:49:19 +00:00
Add more fruits to the fruit basket
This commit is contained in:
parent
b2b6dad75e
commit
551793f249
@ -11,15 +11,16 @@
|
|||||||
// Execute `rustlings hint hashmaps1` or use the `hint` watch subcommand for a
|
// Execute `rustlings hint hashmaps1` or use the `hint` watch subcommand for a
|
||||||
// hint.
|
// hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
fn fruit_basket() -> HashMap<String, u32> {
|
fn fruit_basket() -> HashMap<String, u32> {
|
||||||
let mut basket = // TODO: declare your hash map here.
|
// TODO: declare your hash map here.
|
||||||
|
let mut basket = HashMap::new();
|
||||||
|
|
||||||
// Two bananas are already given for you :)
|
// Two bananas are already given for you :)
|
||||||
|
basket.insert(String::from("apple"), 1);
|
||||||
basket.insert(String::from("banana"), 2);
|
basket.insert(String::from("banana"), 2);
|
||||||
|
basket.insert(String::from("blue berry"), 3);
|
||||||
|
|
||||||
// TODO: Put more fruits in your basket here.
|
// TODO: Put more fruits in your basket here.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user