Skip to content

Commit

Permalink
Fix Map.insert documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aleb committed Nov 22, 2024
1 parent a3a2091 commit 963ab85
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<K, V>(&mut self, key: K, value: V)
where
K: Into<Cow<'a, str>>,
Expand Down

0 comments on commit 963ab85

Please sign in to comment.