Support simd_json (#105)
This PR adds support for the simd-json library whenever decoding or encoding JSON responses. This may be enabled independently of serenity and twilight support for SIMD acceleration. Co-authored-by: Kyle Simpson <kyleandrew.simpson@gmail.com>
This commit is contained in:
committed by
Kyle Simpson
parent
8cc7a22b0b
commit
cb0a74f511
@@ -199,7 +199,7 @@ impl Compressed {
|
||||
)?;
|
||||
let mut metabytes = b"DCA1\0\0\0\0".to_vec();
|
||||
let orig_len = metabytes.len();
|
||||
serde_json::to_writer(&mut metabytes, &metadata)?;
|
||||
crate::json::to_writer(&mut metabytes, &metadata)?;
|
||||
let meta_len = (metabytes.len() - orig_len)
|
||||
.try_into()
|
||||
.map_err(|_| CodecCacheError::MetadataTooLarge)?;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use crate::input::AudioStreamError;
|
||||
use crate::{error::JsonError, input::AudioStreamError};
|
||||
use audiopus::error::Error as OpusError;
|
||||
use serde_json::Error as JsonError;
|
||||
use std::{
|
||||
error::Error as StdError,
|
||||
fmt::{Display, Formatter, Result as FmtResult},
|
||||
|
||||
Reference in New Issue
Block a user