Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Fix Serializer example code on rustc pre-1.47
Browse files Browse the repository at this point in the history
    error[E0277]: arrays only have std trait implementations for lengths 0..=32
      --> src/ser.rs:30:5
       |
    18 |     assert_eq!(buffer, b"---\nk: 107\n...\n---\nj: 106\nk: 107\n");
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[u8; 33]`
       |
       = note: required because of the requirements on the impl of `std::cmp::PartialEq<&[u8; 33]>` for `std::vec::Vec<u8>`
       = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
  • Loading branch information
dtolnay committed Feb 2, 2021
1 parent 5b91abf commit 52de1e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ser.rs
Expand Up @@ -24,10 +24,10 @@ use yaml_rust::{yaml, Yaml, YamlEmitter};
/// object.insert("k", 107);
/// object.serialize(&mut ser)?;
///
/// object.insert("j", 106);
/// object.insert("J", 74);
/// object.serialize(&mut ser)?;
///
/// assert_eq!(buffer, b"---\nk: 107\n...\n---\nj: 106\nk: 107\n");
/// assert_eq!(buffer, b"---\nk: 107\n...\n---\nJ: 74\nk: 107\n");
/// Ok(())
/// }
/// ```
Expand Down

0 comments on commit 52de1e0

Please sign in to comment.