diff --git a/serde/src/ser/mod.rs b/serde/src/ser/mod.rs index d83b729f..b787437e 100644 --- a/serde/src/ser/mod.rs +++ b/serde/src/ser/mod.rs @@ -878,8 +878,10 @@ pub trait Serializer: Sized { /// Collect an iterator as a sequence. /// /// The default implementation serializes each item yielded by the iterator - /// using `Self::SerializeSeq`. Implementors should not need to override - /// this method. + /// using [`serialize_seq`]. Implementors should not need to override this + /// method. + /// + /// [`serialize_seq`]: #tymethod.serialize_seq fn collect_seq(self, iter: I) -> Result where I: IntoIterator, @@ -896,8 +898,10 @@ pub trait Serializer: Sized { /// Collect an iterator as a map. /// /// The default implementation serializes each pair yielded by the iterator - /// using `Self::SerializeMap`. Implementors should not need to override - /// this method. + /// using [`serialize_map`]. Implementors should not need to override this + /// method. + /// + /// [`serialize_map`]: #tymethod.serialize_map fn collect_map(self, iter: I) -> Result where K: Serialize, @@ -914,8 +918,8 @@ pub trait Serializer: Sized { /// Serialize a string produced by an implementation of `Display`. /// - /// The default implementation builds a heap-allocated `String` and - /// delegates to `serialize_str`. Serializers are encouraged to provide a + /// The default implementation builds a heap-allocated [`String`] and + /// delegates to [`serialize_str`]. Serializers are encouraged to provide a /// more efficient implementation if possible. /// /// ```rust @@ -938,6 +942,9 @@ pub trait Serializer: Sized { /// } /// } /// ``` + /// + /// [`String`]: https://doc.rust-lang.org/std/string/struct.String.html + /// [`serialize_str`]: #tymethod.serialize_str #[cfg(any(feature = "std", feature = "collections"))] fn collect_str(self, value: &T) -> Result where