MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / get_mut_unchecked

Method get_mut_unchecked

splashsurf_lib/src/utils.rs:54–57  ·  view source on GitHub ↗
(&self, i: usize)

Source from the content-addressed store, hash-verified

52 /// SAFETY: Calling this method with an out-of-bounds index is undefined behavior.
53 #[allow(clippy::mut_from_ref)]
54 pub unsafe fn get_mut_unchecked(&self, i: usize) -> &mut T {
55 debug_assert!(i < self.len(), "index out of bounds");
56 unsafe { &mut *self.slice.get_unchecked(i).get() }
57 }
58}
59
60/// Ensures that at least the specified total capacity is reserved for the given vector

Calls 1

getMethod · 0.45

Tested by

no test coverage detected