Rename as_string and as_immutable_string.

This commit is contained in:
Stephen Chung
2021-07-24 16:24:59 +08:00
parent b21deaf052
commit 94674679d9
12 changed files with 67 additions and 32 deletions

View File

@@ -547,7 +547,7 @@ impl SerializeMap for DynamicSerializer {
#[cfg(not(feature = "no_object"))]
{
let key = std::mem::take(&mut self._key)
.as_immutable_string()
.into_immutable_string()
.map_err(|typ| {
EvalAltResult::ErrorMismatchDataType(
"string".into(),
@@ -577,7 +577,7 @@ impl SerializeMap for DynamicSerializer {
#[cfg(not(feature = "no_object"))]
{
let _key: Dynamic = _key.serialize(&mut *self)?;
let _key = _key.as_immutable_string().map_err(|typ| {
let _key = _key.into_immutable_string().map_err(|typ| {
EvalAltResult::ErrorMismatchDataType("string".into(), typ.into(), Position::NONE)
})?;
let _value = _value.serialize(&mut *self)?;