pub fn deserialize_ref_cell_option_number_from_string<'de, T, D>(
deserializer: D,
) -> Result<RefCell<Option<T>>, D::Error>
Expand description
Deserializes a RefCell
option number from string or a number. Same logic as "deserialize_option_number_from_string"
.
ยงExample:
use serde_aux::prelude::*;
use std::cell::RefCell;
#[derive(Debug, serde::Deserialize)]
struct MyStruct {
#[serde(default, deserialize_with = "deserialize_ref_cell_option_number_from_string")]
v: RefCell<Option<f32>>
}
let a = serde_qs::from_str::<MyStruct>("v=-0.1").unwrap();
assert_eq!(a.v, RefCell::new(Some(-0.1)));