pub fn parse(values: &[Vec<String>]) -> Self {
        // Iterate over the columns.
        // TODO: make this less horrible
        let mut columns: SwagSheetColumns = Default::default();

        // Get the first row.
        let row = values.get(0).unwrap();

        for (index, col) in row.iter().enumerate() {
            let c = col.to_lowercase();

            if c.contains("timestamp") {
                columns.timestamp = index;
            }
            if c.contains("name") {
                columns.name = index;
            }
            if c.contains("email address") {
                columns.email = index;
            }
            if c.contains("fleece") {
                columns.fleece_size = index;
            }
            if c.contains("hoodie") {
                columns.hoodie_size = index;
            }
            if c.contains("women's tee") {
                columns.womens_shirt_size = index;
            }
            if c.contains("unisex tee") {
                columns.unisex_shirt_size = index;
            }
            if c.contains("onesie") {
                columns.kids_shirt_size = index;
            }
            if c.contains("street address line 1") {
                columns.street_1 = index;
            }
            if c.contains("street address line 2") {
                columns.street_2 = index;
            }
            if c.contains("city") {
                columns.city = index;
            }
            if c.contains("state") {
                columns.state = index;
            }
            if c.contains("zipcode") {
                columns.zipcode = index;
            }
            if c.contains("country") {
                columns.country = index;
            }
            if c.contains("phone") {
                columns.phone = index;
            }
            if c.contains("sent") {
                columns.sent = index;
            }
        }
        columns
    }
/// Parse the sheet columns from Google Sheets values.
Parse the sheet columns from Google Sheets values.
Parse the sheet columns from Google Sheets values .
pub fn parse(values: &[Vec<String>]) -> Self {
        // Iterate over the columns.
        // TODO: make this less horrible
        let mut columns: SwagSheetColumns = Default::default();
        // Get the first row.
        let row = values.get(0).unwrap();
        for (index, col) in row.iter().enumerate() {
            let c = col.to_lowercase();
            if c.contains("timestamp") {
                columns.timestamp = index;
            }
            if c.contains("name") {
                columns.name = index;
            }
            if c.contains("email address") {
                columns.email = index;
            }
            if c.contains("fleece") {
                columns.fleece_size = index;
            }
            if c.contains("hoodie") {
                columns.hoodie_size = index;
            }
            if c.contains("women's tee") {
                columns.womens_shirt_size = index;
            }
            if c.contains("unisex tee") {
                columns.unisex_shirt_size = index;
            }
            if c.contains("onesie") {
                columns.kids_shirt_size = index;
            }
            if c.contains("street address line 1") {
                columns.street_1 = index;
            }
            if c.contains("street address line 2") {
                columns.street_2 = index;
            }
            if c.contains("city") {
                columns.city = index;
            }
            if c.contains("state") {
                columns.state = index;
            }
            if c.contains("zipcode") {
                columns.zipcode = index;
            }
            if c.contains("country") {
                columns.country = index;
            }
            if c.contains("phone") {
                columns.phone = index;
            }
            if c.contains("sent") {
                columns.sent = index;
            }
        }
        columns
    }
pub fn parse ( values : & [ Vec < String > ] ) -> Self { // Iterate over the columns. // TODO: make this less horrible let mut columns : SwagSheetColumns = Default :: default ( ) ; // Get the first row. let row = values . get ( 0 ) . unwrap ( ) ; for ( index , col ) in row . iter ( ) . enumerate ( ) { let c = col . to_lowercase ( ) ; if c . contains ( " " ) { columns . timestamp = index ; } if c . contains ( " " ) { columns . name = index ; } if c . contains ( " " ) { columns . email = index ; } if c . contains ( " " ) { columns . fleece_size = index ; } if c . contains ( " " ) { columns . hoodie_size = index ; } if c . contains ( " " ) { columns . womens_shirt_size = index ; } if c . contains ( " " ) { columns . unisex_shirt_size = index ; } if c . contains ( " " ) { columns . kids_shirt_size = index ; } if c . contains ( " " ) { columns . street_1 = index ; } if c . contains ( " " ) { columns . street_2 = index ; } if c . contains ( " " ) { columns . city = index ; } if c . contains ( " " ) { columns . state = index ; } if c . contains ( " " ) { columns . zipcode = index ; } if c . contains ( " " ) { columns . country = index ; } if c . contains ( " " ) { columns . phone = index ; } if c . contains ( " " ) { columns . sent = index ; } } columns }
Parse the sheet columns from Google Sheets values.
Parse the sheet columns from Google Sheets values .
values
&[Vec<String>]
values
&[Vec<String>]