Skip to content

Commit

Permalink
docs: improve Metadata::set_* docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaDve committed Aug 2, 2024
1 parent 363b70d commit 05c4b83
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ impl Metadata {
self.0.get(key)
}

/// Sets the value for the given key and returns the previous value, if any.
/// Replaces the value for the given key and returns the previous value, if any.
///
/// If the given value is `None`, the key is removed from the metadata,
/// if any.
/// The entry is removed if the given value is `None`.
pub fn set(
&mut self,
key: &str,
Expand All @@ -96,7 +95,9 @@ impl Metadata {
self.set_value(key, value.map(|value| value.into()))
}

/// Sets the value for the given key and returns the previous value, if any.
/// Replaces the value for the given key and returns the previous value, if any.
///
/// The entry is removed if the given value is `None`.
///
/// This behaves like [`Metadata::set`], but this takes a [`enum@Value`]
/// instead of a generic type.
Expand Down

0 comments on commit 05c4b83

Please sign in to comment.