Function deserialize_vec_from_lua_array_or_string

Source
pub fn deserialize_vec_from_lua_array_or_string<'de, D, T>(
    deserializer: D,
) -> Result<Vec<T>, D::Error>
where D: Deserializer<'de>, T: From<String>,
Expand description

Deserialize a json value into a Vec, treating empty json objects as empty lists If the json value is a string, this returns a singleton vector containing that value. This is needed to be able to deserialise RockSpec tables that luarocks also allows to be strings.