5 Commits

Author SHA1 Message Date
David Tolnay
37da27fc77
Merge pull request 822 from deankarn/master 2021-11-12 19:05:05 -08:00
Dean Karn
0992b44721 only include retain for BTreeMap if Rust 1.53.0+ 2021-11-11 21:19:51 -08:00
Dean Karn
d275e04a77 Add retain to Map
This adds the `retain` function to the Map type which calls the inner
maps, Either indexmap or std BTreeMap's, retain.

I'm trying to mutate a Value::Object's Map in-place and could't find a
nice way without the retain function.
2021-11-11 20:24:37 -08:00
David Tolnay
3040daa1c6
Update tests to 2018 edition 2020-01-22 13:45:47 -08:00
Dean Karn
a240606c32 Add append to Map
This adds append to the Map type. There are two underlying map type ATM:
- BTreeMap
- IndexMap

For BTreeMap this exposes the existing append method which has some nice
perf benefits vs doing a for on the other map and insert on each
element.

For IndexMap there is no existing append method and so as a fallback and
convenience there is a for over the elements and insert simulating an
append.
2020-01-07 08:16:08 -08:00