Fix builds.

This commit is contained in:
Stephen Chung
2021-12-02 17:46:39 +08:00
parent 27c0181035
commit 9a5bd9396a
3 changed files with 28 additions and 9 deletions

View File

@@ -260,8 +260,17 @@ impl Serializer for &mut DynamicSerializer {
Ok(v.into())
}
fn serialize_bytes(self, v: &[u8]) -> Result<Self::Ok, Box<EvalAltResult>> {
Ok(v.into())
fn serialize_bytes(self, _v: &[u8]) -> Result<Self::Ok, Box<EvalAltResult>> {
#[cfg(not(feature = "no_index"))]
return Ok(Dynamic::from_blob(_v.to_vec()));
#[cfg(feature = "no_index")]
return Err(EvalAltResult::ErrorMismatchDataType(
"".into(),
"BLOB's are not supported with 'no_index'".into(),
Position::NONE,
)
.into());
}
fn serialize_none(self) -> Result<Self::Ok, Box<EvalAltResult>> {