Skip to content

Commit

Permalink
Rust rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonMc555 committed May 21, 2024
1 parent ab64d6f commit c8ee957
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ pub enum Error {
impl Display for Error {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Error::IndicesOutOfBounds(row, column) => write!(f, "indices ({row}, {column}) out of bounds"),
Error::IndicesOutOfBounds(row, column) => {
write!(f, "indices ({row}, {column}) out of bounds")
}
Error::IndexOutOfBounds(index) => write!(f, "index {index} out of bounds"),
Error::DimensionMismatch => write!(f, "dimension mismatch"),
Error::NotEnoughElements => write!(f, "not enough elements"),
Expand Down Expand Up @@ -875,7 +877,10 @@ impl<T> Array2D<T> {
/// ```
///
/// [`Iterator`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html
pub fn row_iter(&self, row_index: usize) -> Result<impl DoubleEndedIterator<Item = &T> + Clone, Error> {
pub fn row_iter(
&self,
row_index: usize,
) -> Result<impl DoubleEndedIterator<Item = &T> + Clone, Error> {
let start = self
.get_index(row_index, 0)
.ok_or(Error::IndicesOutOfBounds(row_index, 0))?;
Expand Down

0 comments on commit c8ee957

Please sign in to comment.