MCPcopy Create free account
hub / github.com/PerroEngine/Perro / swap_cells

Method swap_cells

perro_source/core/perro_structs/src/structs/matrix/mod.rs:737–746  ·  view source on GitHub ↗
(&mut self, a: (usize, usize), b: (usize, usize))

Source from the content-addressed store, hash-verified

735
736 #[inline]
737 pub fn swap_cells(&mut self, a: (usize, usize), b: (usize, usize)) -> bool {
738 let Some(a_index) = Self::flat_index(a.0, a.1) else {
739 return false;
740 };
741 let Some(b_index) = Self::flat_index(b.0, b.1) else {
742 return false;
743 };
744 self.as_mut_slice().swap(a_index, b_index);
745 true
746 }
747
748 #[inline]
749 pub fn swap_flat(&mut self, a: usize, b: usize) -> bool {

Callers

nothing calls this directly

Calls 1

as_mut_sliceMethod · 0.80

Tested by

no test coverage detected