Skip to content

Commit

Permalink
style: 🎨 Run cargo format on code
Browse files Browse the repository at this point in the history
  • Loading branch information
pcbowers committed Dec 16, 2023
1 parent 0abdd03 commit 2b72fb7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,11 @@ impl<T> Grid<T> {
/// Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.
#[inline]
#[must_use]
pub unsafe fn get_unchecked_mut(&mut self, row: impl Into<usize>, col: impl Into<usize>) -> &mut T {
pub unsafe fn get_unchecked_mut(
&mut self,
row: impl Into<usize>,
col: impl Into<usize>,
) -> &mut T {
let index = self.get_index(row.into(), col.into());
self.data.get_unchecked_mut(index)
}
Expand All @@ -530,7 +534,11 @@ impl<T> Grid<T> {
/// Mutable access to a certain element in the grid.
/// Returns `None` if an element beyond the grid bounds is tried to be accessed.
#[must_use]
pub fn get_mut(&mut self, row: impl TryInto<usize>, col: impl TryInto<usize>) -> Option<&mut T> {
pub fn get_mut(
&mut self,
row: impl TryInto<usize>,
col: impl TryInto<usize>,
) -> Option<&mut T> {
let row_usize = row.try_into().ok()?;
let col_usize = col.try_into().ok()?;
if row_usize < self.rows && col_usize < self.cols {
Expand Down

0 comments on commit 2b72fb7

Please sign in to comment.