diff options
author | Raghav-Bell <raghavsingla327@gmail.com> | 2023-10-01 23:14:10 +0530 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2023-10-04 12:42:01 +0200 |
commit | 8e35a567121a7186d77e12e249490210c6eb75a9 (patch) | |
tree | 4ffb20118e01fa9090aaedfc8f97c6956e372ad4 /examples | |
parent | 9f795dd9472b24848fe1e2c087cf8163be280fa1 (diff) |
Updated version of `serde_yaml` to 0.9
Diffstat (limited to 'examples')
-rw-r--r-- | examples/yaml.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/yaml.rs b/examples/yaml.rs index 78df2464..fe95dac0 100644 --- a/examples/yaml.rs +++ b/examples/yaml.rs @@ -23,7 +23,8 @@ fn main() { }], }; - let bytes = serde_yaml::to_vec(&person).unwrap(); + let mut bytes = Vec::with_capacity(128); + serde_yaml::to_writer(&mut bytes, &person).unwrap(); PrettyPrinter::new() .language("yaml") .line_numbers(true) |