Skip to content

Commit

Permalink
More rustdoc cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbb committed Jan 20, 2024
1 parent 0f5ad6d commit 442beff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
12 changes: 7 additions & 5 deletions serde_with/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ pub struct As<T: ?Sized>(PhantomData<T>);
/// Adapter to convert from `serde_as` to the serde traits.
///
/// This is the counter-type to [`As`][].
/// It can be used whenever a type implementing [`DeserializeAs`][]/[`SerializeAs`][] is required but the normal `Deserialize`/`Serialize` traits should be used.
/// It can be used whenever a type implementing [`DeserializeAs`]/[`SerializeAs`] is required but the normal [`Deserialize`](::serde::Deserialize)/[`Serialize`](::serde::Serialize) traits should be used.
/// Check [`As`] for an example.
pub struct Same;

Expand Down Expand Up @@ -1636,8 +1636,11 @@ pub struct Bytes;
/// This distinction is not semantically important on the Rust side, thus both forms should deserialize into the same `Vec`.
///
/// The `OneOrMany` adapter achieves exactly this use case.
/// The serialization behavior can be tweaked to either always serialize as a list using `PreferMany` or to serialize as the inner element if possible using `PreferOne`.
/// By default, `PreferOne` is assumed, which can also be omitted like `OneOrMany<_>`.
/// The serialization behavior can be tweaked to either always serialize as a list using [`PreferMany`] or to serialize as the inner element if possible using [`PreferOne`].
/// By default, [`PreferOne`] is assumed, which can also be omitted like `OneOrMany<_>`.
///
/// [`PreferMany`]: crate::formats::PreferMany
/// [`PreferOne`]: crate::formats::PreferOne
///
/// # Examples
///
Expand Down Expand Up @@ -2518,10 +2521,9 @@ pub struct SetLastValueWins<T>(PhantomData<T>);
/// Helper for implementing [`JsonSchema`] on serializers whose output depends
/// on the type of the concrete field.
///
/// It is added implicitly by the [`#[serde_as]`] macro when any `schemars`
/// It is added implicitly by the [`#[serde_as]`](crate::serde_as) macro when any `schemars`
/// feature is enabled.
///
/// [`JsonSchema`]: ::schemars_0_8::JsonSchema
/// [`#[serde_as]`]: crate::serde_as
#[cfg(feature = "schemars_0_8")]
pub struct Schema<T: ?Sized, TA>(PhantomData<T>, PhantomData<TA>);
4 changes: 3 additions & 1 deletion serde_with/src/serde_conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
/// 2. The type `T` we want to extend with custom behavior.
/// 3. A function or macro taking a `&T` and returning a serializable type.
/// 4. A function or macro taking a deserializable type and returning a `Result<T, E>`.
/// The error type `E` must implement `Display`.
/// The error type `E` must implement [`Display`].
///
/// [`Display`]: std::fmt::Display
///
/// # Example
///
Expand Down
3 changes: 3 additions & 0 deletions serde_with/src/time_0_3.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! De/Serialization of [time v0.3][time] types
//!
//! This modules is only available if using the `time_0_3` feature of the crate.
//! No extra types are exposed. Instead it enables support for [`time_0_3::Duration`] together with [`DurationSeconds`] and its variants.
//! The types [`time_0_3::PrimitiveDateTime`] and [`time_0_3::OffsetDateTime`] are supported by [`TimestampSeconds`] and its variants.
//! The well-known format descriptions [`Rfc2822`], [`Rfc3339`] and [`Iso8601`] are supported for [`OffsetDateTime`].
//!
//! [time]: https://docs.rs/time/0.3/
Expand Down

0 comments on commit 442beff

Please sign in to comment.