Skip to content

Commit a348da3

Browse files
authored
Add serde_as deserialize_as explain (#958)
Added explanation details regarding deserialize_as. Close #766
2 parents 2e5bc20 + a7ffe7c commit a348da3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

serde_with_macros/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ fn field_has_attribute(field: &Field, namespace: &str, name: &str) -> bool {
456456
/// # Example
457457
///
458458
/// ```rust,ignore
459-
/// use serde_with::{serde_as, DisplayFromStr, Map};
459+
/// use serde_with::{serde_as, BytesOrString, DisplayFromStr, Map};
460460
///
461461
/// #[serde_as]
462462
/// #[derive(Serialize, Deserialize)]
@@ -465,8 +465,11 @@ fn field_has_attribute(field: &Field, namespace: &str, name: &str) -> bool {
465465
/// #[serde_as(as = "_")]
466466
/// a: u32,
467467
///
468-
/// /// Serialize into String
469-
/// #[serde_as(as = "DisplayFromStr")]
468+
/// /// Serialize into String, deserialize from Bytes or String
469+
/// #[serde_as(
470+
/// serialize_as = "DisplayFromStr",
471+
/// deserialize_as = "BytesOrString"
472+
/// )]
470473
/// b: u32,
471474
///
472475
/// /// Serialize into a map from String to String

0 commit comments

Comments
 (0)