Skip to content

Commit

Permalink
serde-lexpr: Add comment notice why to_value is "by-value"
Browse files Browse the repository at this point in the history
The comment wording is taken directly from `serde_json`.

Closes #71.
  • Loading branch information
Andreas Rottmann committed Feb 7, 2024
1 parent e3d6b90 commit a99e5df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions serde-lexpr/src/value/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ impl ser::SerializeStructVariant for SerializeStructVariant {
/// let val = serde_lexpr::to_value("s").unwrap();
/// assert_eq!(val, Value::string("s"));
/// ```
// Taking by value is more friendly to iterator adapters, option and result
// consumers, etc. See <https://github.com/serde-rs/json/pull/149>.
pub fn to_value<T>(value: T) -> Result<Value>
where
T: ser::Serialize,
Expand Down

0 comments on commit a99e5df

Please sign in to comment.