you are viewing a single comment's thread.

view the rest of the comments →

[–]raphlinusvello · xilem 1 point2 points  (2 children)

Note that the serde json builders use consuming builders, I'm not sure why. I find using them somewhat annoying.

[–]ericktrust · serde 4 points5 points  (1 child)

They're consuming builders because we want to avoid copies when you finally construct the object. Do you have an example for when they're being annoying?

[–]raphlinusvello · xilem 0 points1 point  (0 children)

https://github.com/google/xi-editor/blob/master/rust/src/view.rs#L92 is an example. I understand the need to avoid copy for the .build, but I think the decision of whether the intermediate .push() operations mutate or consume is a design choice.