You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to understand the purpose of this function. AFAICT this is replacing any empty map inside a Value::Object with a Map::new(). However, my impression is that these should be equivalent... am I missing something here?
fnwrap_value(value:Value) -> Value{match value {// If the value is an object, check if it's empty Value::Object(map) => {if map.is_empty(){// Wrap empty map as an empty JSON object Value::Object(Map::new())}else{// Recursively wrap each key-value pair in the map Value::Object(map.into_iter().map(|(k, v)| (k,wrap_value(v))).collect())}}// If the value is an array, recursively wrap each element Value::Array(arr) => Value::Array(arr.into_iter().map(wrap_value).collect()),// If the value is null, return it as is Value::Null => Value::Null,// For primitive values, return them as is
other => other,}}
The text was updated successfully, but these errors were encountered:
rusty_paseto/src/generic/builders/generic_builder.rs
Line 184 in 2e60fdd
I'm trying to understand the purpose of this function. AFAICT this is replacing any empty map inside a
Value::Object
with aMap::new()
. However, my impression is that these should be equivalent... am I missing something here?The text was updated successfully, but these errors were encountered: