Hyperlink the serialize_entry documentation

This commit is contained in:
David Tolnay
2017-04-13 14:27:13 -07:00
parent 35313257c5
commit 09bd8287e7
+12 -8
View File
@@ -1291,17 +1291,21 @@ pub trait SerializeMap {
/// Serialize a map entry consisting of a key and a value. /// Serialize a map entry consisting of a key and a value.
/// ///
/// Some `Serialize` types are not able to hold a key and value in memory at /// Some [`Serialize`] types are not able to hold a key and value in memory
/// the same time so `SerializeMap` implementations are required to support /// at the same time so `SerializeMap` implementations are required to
/// `serialize_key` and `serialize_value` individually. The /// support [`serialize_key`] and [`serialize_value`] individually. The
/// `serialize_entry` method allows serializers to optimize for the case /// `serialize_entry` method allows serializers to optimize for the case
/// where key and value are both available. `Serialize` implementations are /// where key and value are both available. [`Serialize`] implementations
/// encouraged to use `serialize_entry` if possible. /// are encouraged to use `serialize_entry` if possible.
/// ///
/// The default implementation delegates to `serialize_key` and /// The default implementation delegates to [`serialize_key`] and
/// `serialize_value`. This is appropriate for serializers that do not care /// [`serialize_value`]. This is appropriate for serializers that do not
/// about performance or are not able to optimize `serialize_entry` any /// care about performance or are not able to optimize `serialize_entry` any
/// better than this. /// better than this.
///
/// [`Serialize`]: ../trait.Serialize.html
/// [`serialize_key`]: #tymethod.serialize_key
/// [`serialize_value`]: #tymethod.serialize_value
fn serialize_entry<K: ?Sized, V: ?Sized>( fn serialize_entry<K: ?Sized, V: ?Sized>(
&mut self, &mut self,
key: &K, key: &K,