Skip to content

Commit 8cf3724

Browse files
authored
docs: correct format examples Fixes #276 (#278)
examples in the documentations were swapped between `into_serde` and `from_serde`
1 parent f748b49 commit 8cf3724

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/utils/src/format/json.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ pub trait JsValueSerdeExt: private::Sealed {
2929
/// use gloo_utils::format::JsValueSerdeExt;
3030
///
3131
/// # fn no_run() {
32-
/// assert_eq!(JsValue::from("bar").into_serde::<String>().unwrap(), "bar");
32+
/// let array = vec![1,2,3];
33+
/// let obj = JsValue::from_serde(&array);
3334
/// # }
3435
/// ```
3536
/// # Errors
@@ -63,8 +64,7 @@ pub trait JsValueSerdeExt: private::Sealed {
6364
/// use gloo_utils::format::JsValueSerdeExt;
6465
///
6566
/// # fn no_run() {
66-
/// let array = vec![1,2,3];
67-
/// let obj = JsValue::from_serde(&array);
67+
/// assert_eq!(JsValue::from("bar").into_serde::<String>().unwrap(), "bar");
6868
/// # }
6969
/// ```
7070
///

0 commit comments

Comments
 (0)