fn none_as_brackets<S, T>(t: &Option<T>, s: S) -> Result<S::Ok, S::Error>
where
    T: Serialize,
    S: Serializer,
{
    match t {
        Some(ref value) => s.serialize_some(value),
        None => s.serialize_map(Some(0))?.end(),
    }
}
/// Serialise nil as brackets, a strange kongfig idiom
Serialise nil as brackets, a strange kongfig idiom
Serialise nil as brackets a strange kongfig idiom
fn none_as_brackets<S, T>(t: &Option<T>, s: S) -> Result<S::Ok, S::Error>
where
    T: Serialize,
    S: Serializer,
{
    match t {
        Some(ref value) => s.serialize_some(value),
        None => s.serialize_map(Some(0))?.end(),
    }
}
fn none_as_brackets < S , T > ( t : & Option < T > , s : S ) -> Result < S :: Ok , S :: Error > where T : Serialize , S : Serializer , { match t { Some ( ref value ) => s . serialize_some ( value ) , None => s . serialize_map ( Some ( 0 ) ) ? . end ( ) , } }
Serialise nil as brackets, a strange kongfig idiom
Serialise nil as brackets a strange kongfig idiom
t
&Option<T>
s
S
t
&Option<T>
s
S