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

Commit

Permalink
remove branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Feb 5, 2022
1 parent 270f495 commit c92bf69
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/io/json/write/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn utf8_serializer<'a, O: Offset>(
array.iter(),
|x, buf| {
if let Some(x) = x {
utf8_serialize(x, buf)
serde_json::to_writer(buf, x).unwrap();
} else {
buf.extend_from_slice(b"null")
}
Expand Down Expand Up @@ -136,20 +136,6 @@ fn list_serializer<'a, O: Offset>(
))
}

#[inline]
fn utf8_serialize(value: &str, buf: &mut Vec<u8>) {
if value.as_bytes().is_ascii() && !value.contains('"') {
buf.reserve(value.len() + 2);
buf.push(b'"');
buf.extend_from_slice(value.as_bytes());
buf.push(b'"');
} else {
// it may contain reserved keywords: perform roundtrip for
// todo: avoid this roundtrip over serde_json
serde_json::to_writer(buf, value).unwrap();
}
}

fn new_serializer<'a>(
array: &'a dyn Array,
) -> Box<dyn StreamingIterator<Item = [u8]> + 'a + Send + Sync> {
Expand Down

0 comments on commit c92bf69

Please sign in to comment.