From 73a55dbf3fe5329b8b4ce00bd0daedec419b5059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandru=20B=C4=83lu=C8=9B?= Date: Tue, 19 Nov 2024 16:36:44 +0100 Subject: [PATCH] Fix Map.insert documentation --- src/map.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/map.rs b/src/map.rs index f2388ad..30e5b1f 100644 --- a/src/map.rs +++ b/src/map.rs @@ -36,7 +36,15 @@ impl<'a> Map<'a> { /// Insert a new element in this `Map` /// - /// Overwrites elements with the same `key`, if present. + /// If the `key` is already present, the `value` is appended to the existing value: + /// + /// ``` + /// let mut map = rusty_s3::Map::new(); + /// map.insert("k", "a"); + /// assert_eq!(map.get("k"), Some("a")); + /// map.insert("k", "b"); + /// assert_eq!(map.get("k"), Some("a, b")); + /// ``` pub fn insert(&mut self, key: K, value: V) where K: Into>,