fn coerce_oversized_errors<T>(&self, result: Result<T, Error>) -> Result<T, Error> {
        let max_size = self.size_range.end - 1;
        match result {
            Err(Error::CellParse{y, ..}) if y == max_size =>
                Err(Error::GridSize{
                    size: max_size + 1, expected: self.size_range.clone()
                }),
            Err(Error::CellParse{x, y, ..}) if x == max_size =>
                Err(Error::RowLength {
                    y: y, size: max_size + 1, expected: max_size
                }),
            _ => result,
        }
    }
// It might be confusing for parse_rows() to return ParseCell errors for cells that
// fall outside of allowed sizes, so we convert such errors into GridSize or RowLength
// errors. The advantage of using RowLength errors is that it can convey information
// about WHICH row was too long.
It might be confusing for parse_rows() to return ParseCell errors for cells that
fall outside of allowed sizes, so we convert such errors into GridSize or RowLength
errors. The advantage of using RowLength errors is that it can convey information
about WHICH row was too long.
It might be confusing for parse_rows () to return ParseCell errors for cells that fall outside of allowed sizes so we convert such errors into GridSize or RowLength errors . The advantage of using RowLength errors is that it can convey information about WHICH row was too long .
fn coerce_oversized_errors<T>(&self, result: Result<T, Error>) -> Result<T, Error> {
        let max_size = self.size_range.end - 1;
        match result {
            Err(Error::CellParse{y, ..}) if y == max_size =>
                Err(Error::GridSize{
                    size: max_size + 1, expected: self.size_range.clone()
                }),
            Err(Error::CellParse{x, y, ..}) if x == max_size =>
                Err(Error::RowLength {
                    y: y, size: max_size + 1, expected: max_size
                }),
            _ => result,
        }
    }
fn coerce_oversized_errors < T > ( & self , result : Result < T , Error > ) -> Result < T , Error > { let max_size = self . size_range . end - 1 ; match result { Err ( Error :: CellParse { y , .. } ) if y == max_size => Err ( Error :: GridSize { size : max_size + 1 , expected : self . size_range . clone ( ) } ) , Err ( Error :: CellParse { x , y , .. } ) if x == max_size => Err ( Error :: RowLength { y : y , size : max_size + 1 , expected : max_size } ) , _ => result , } }
It might be confusing for parse_rows() to return ParseCell errors for cells that
fall outside of allowed sizes, so we convert such errors into GridSize or RowLength
errors.
It might be confusing for parse_rows () to return ParseCell errors for cells that fall outside of allowed sizes so we convert such errors into GridSize or RowLength errors .
&self
result
Result<T, Error>
&self
result
Result<T, Error>