Remove Simd-json (#228)
This mirrors the serenity pr https://github.com/serenity-rs/serenity/pull/2735.
This commit is contained in:
@@ -196,7 +196,7 @@ impl Compressed {
|
||||
)?;
|
||||
let mut metabytes = b"DCA1\0\0\0\0".to_vec();
|
||||
let orig_len = metabytes.len();
|
||||
crate::json::to_writer(&mut metabytes, &metadata)?;
|
||||
serde_json::to_writer(&mut metabytes, &metadata)?;
|
||||
let meta_len = (metabytes.len() - orig_len)
|
||||
.try_into()
|
||||
.map_err(|_| CodecCacheError::MetadataTooLarge)?;
|
||||
|
||||
@@ -109,11 +109,9 @@ impl FormatReader for DcaReader {
|
||||
return symph_err::decode_error("missing DCA1 metadata block");
|
||||
}
|
||||
|
||||
let mut raw_json = source.read_boxed_slice_exact(size as usize)?;
|
||||
let raw_json = source.read_boxed_slice_exact(size as usize)?;
|
||||
|
||||
// NOTE: must be mut for simd-json.
|
||||
#[allow(clippy::unnecessary_mut_passed)]
|
||||
let metadata: DcaMetadata = crate::json::from_slice::<DcaMetadata>(&mut raw_json)
|
||||
let metadata: DcaMetadata = serde_json::from_slice::<DcaMetadata>(&raw_json)
|
||||
.map_err(|_| SymphError::DecodeError("malformed DCA1 metadata block"))?;
|
||||
|
||||
let mut revision = MetadataBuilder::new();
|
||||
|
||||
@@ -49,7 +49,7 @@ pub struct AuxMetadata {
|
||||
impl AuxMetadata {
|
||||
/// Extract metadata and details from the output of `ffprobe -of json`.
|
||||
pub fn from_ffprobe_json(value: &mut [u8]) -> Result<Self, JsonError> {
|
||||
let output: ffprobe::Output = crate::json::from_slice(value)?;
|
||||
let output: ffprobe::Output = serde_json::from_slice(value)?;
|
||||
|
||||
Ok(output.into_aux_metadata())
|
||||
}
|
||||
|
||||
@@ -164,11 +164,11 @@ impl<'a> YoutubeDl<'a> {
|
||||
));
|
||||
}
|
||||
|
||||
// NOTE: must be split_mut for simd-json.
|
||||
let out = output
|
||||
.stdout
|
||||
.split_mut(|&b| b == b'\n')
|
||||
.filter_map(|x| (!x.is_empty()).then(|| crate::json::from_slice(x)))
|
||||
.split(|&b| b == b'\n')
|
||||
.filter(|&x| (!x.is_empty()))
|
||||
.map(|x| serde_json::from_slice(x))
|
||||
.collect::<Result<Vec<Output>, _>>()
|
||||
.map_err(|e| AudioStreamError::Fail(Box::new(e)))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user