Implement Serialize for flexbuffer::Reader (#6635)

* Implement Serialize for flexbuffer::Reader

* bump version

* Remove use of experimantal or-patterns

* Remove more use of experimantal or-patterns

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2021-05-10 23:15:46 -04:00
committed by GitHub
parent a1730fcea8
commit 8fd10606c1
9 changed files with 125 additions and 40 deletions

View File

@@ -97,8 +97,7 @@ pub(super) fn sort_map_by_keys(values: &mut [Value], buffer: &[u8]) {
// preferred over custom sorting or adding another dependency. By construction, this part
// of the values stack must be alternating (key, value) pairs. The public API must not be
// able to trigger the above debug_assets that protect this unsafe usage.
let pairs: &mut [[Value; 2]] =
unsafe { std::slice::from_raw_parts_mut(raw_pairs, pairs_len) };
let pairs: &mut [[Value; 2]] = unsafe { std::slice::from_raw_parts_mut(raw_pairs, pairs_len) };
#[rustfmt::skip]
pairs.sort_unstable_by(|[key1, _], [key2, _]| {
if let Value::Key(a1) = *key1 {