Function parse_one_or_many

Source
pub fn parse_one_or_many<T: DeserializeOwned>(
    bytes: &[u8],
) -> Result<Vec<T>, Error>
Expand description

Deserialize migrate_args as either a single migration (legacy wire shape, a JSON object) or an ordered list (a JSON array). A migration is JSON-tagged by from_version, so the first non-whitespace byte disambiguates: [ is a list, anything else a single object wrapped into a one-element chain. Keeps the pre-list wire format working unchanged.