diff options
Diffstat (limited to 'games-rpg/rpg-cli/files/rpg-cli-1.0.0-into_values.patch')
-rw-r--r-- | games-rpg/rpg-cli/files/rpg-cli-1.0.0-into_values.patch | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/games-rpg/rpg-cli/files/rpg-cli-1.0.0-into_values.patch b/games-rpg/rpg-cli/files/rpg-cli-1.0.0-into_values.patch new file mode 100644 index 000000000000..9130df5c42be --- /dev/null +++ b/games-rpg/rpg-cli/files/rpg-cli-1.0.0-into_values.patch @@ -0,0 +1,21 @@ +Fix build with <rust-1.54 + +error[E0658]: use of unstable library feature 'map_into_keys_values' + --> src/item/chest.rs:111:51 + | +111 | let mut items: Vec<Box<dyn Item>> = items.into_values().flatten().collect(); + | ^^^^^^^^^^^ + | + = note: see issue #75294 <https://github.com/rust-lang/rust/issues/75294> for more information + +--- a/src/item/chest.rs ++++ b/src/item/chest.rs +@@ -108,7 +108,7 @@ impl Chest { + /// Remove the gold, items and equipment from a hero and return them as a new chest. + pub fn drop(game: &mut game::Game) -> Self { + let items: HashMap<Key, Vec<Box<dyn Item>>> = game.inventory.drain().collect(); +- let mut items: Vec<Box<dyn Item>> = items.into_values().flatten().collect(); ++ let mut items: Vec<Box<dyn Item>> = items.into_iter().map(|(_, v)| v).flatten().collect(); + let sword = game.player.sword.take(); + let shield = game.player.shield.take(); + |