fn add_empty_array(frame: Frame, key: &str) -> Frame {
    match frame {
        Frame::Map {
            mut data,
            attributes: _,
        } => {
            data.remove(&CmdStr::new(key).to_blob());
            data.insert(
                CmdStr::new(key).to_blob(),
                Frame::Array {
                    data: vec![],
                    attributes: None,
                },
            );
            Frame::Map {
                data,
                attributes: None,
            }
        }
        frame => frame,
    }
}
/// Replaces the associates element by an empty array
Replaces the associates element by an empty array
Replaces the associates element by an empty array
fn add_empty_array(frame: Frame, key: &str) -> Frame {
    match frame {
        Frame::Map {
            mut data,
            attributes: _,
        } => {
            data.remove(&CmdStr::new(key).to_blob());
            data.insert(
                CmdStr::new(key).to_blob(),
                Frame::Array {
                    data: vec![],
                    attributes: None,
                },
            );
            Frame::Map {
                data,
                attributes: None,
            }
        }
        frame => frame,
    }
}
fn add_empty_array ( frame : Frame , key : & str ) -> Frame { match frame { Frame :: Map { mut data , attributes : _ , } => { data . remove ( & CmdStr :: new ( key ) . to_blob ( ) ) ; data . insert ( CmdStr :: new ( key ) . to_blob ( ) , Frame :: Array { data : vec ! [ ] , attributes : None , } , ) ; Frame :: Map { data , attributes : None , } } frame => frame , } }
Replaces the associates element by an empty array
Replaces the associates element by an empty array
frame
Frame
key
&str
frame
Frame
key
&str