fn parse_query(query: HashMap<String, String>) -> Result<Option<Id>, Response> {
    if query.is_empty() {
        return Ok(None);
    }

    if query.len() > 1 {
        return Err(create_422());
    }

    match query
        .get(QUERY_FIELD)
        .and_then(|id_str| id_str.parse::<Id>().ok())
    {
        Some(id) => Ok(Some(id)),
        None => Err(create_422()),
    }
}
/// Extracts the starting event ID from the provided query, or `None` if `query` is empty.
///
/// If `query` is not empty, returns a 422 response if `query` doesn't have exactly one entry,
/// "starts_from" mapped to a value representing an event ID.
Extracts the starting event ID from the provided query, or `None` if `query` is empty.
If `query` is not empty, returns a 422 response if `query` doesn't have exactly one entry,
"starts_from" mapped to a value representing an event ID.
Extracts the starting event ID from the provided query or ` None ` if ` query ` is empty . If ` query ` is not empty returns a 422 response if ` query ` doesn ' t have exactly one entry " starts_from " mapped to a value representing an event ID .
fn parse_query(query: HashMap<String, String>) -> Result<Option<Id>, Response> {
    if query.is_empty() {
        return Ok(None);
    }
    if query.len() > 1 {
        return Err(create_422());
    }
    match query
        .get(QUERY_FIELD)
        .and_then(|id_str| id_str.parse::<Id>().ok())
    {
        Some(id) => Ok(Some(id)),
        None => Err(create_422()),
    }
}
fn parse_query ( query : HashMap < String , String > ) -> Result < Option < Id > , Response > { if query . is_empty ( ) { return Ok ( None ) ; } if query . len ( ) > 1 { return Err ( create_422 ( ) ) ; } match query . get ( QUERY_FIELD ) . and_then ( | id_str | id_str . parse :: < Id > ( ) . ok ( ) ) { Some ( id ) => Ok ( Some ( id ) ) , None => Err ( create_422 ( ) ) , } }
Extracts the starting event ID from the provided query, or `None` if `query` is empty.
Extracts the starting event ID from the provided query or ` None ` if ` query ` is empty .
query
HashMap<String, String>
query
HashMap<String, String>