MCPcopy Create free account
hub / github.com/RustCrypto/utils / raw_pos

Method raw_pos

sponge-cursor/src/lib.rs:51–60  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

49 #[inline(always)]
50 #[allow(clippy::missing_panics_doc, reason = "the method is panic-free")]
51 pub fn raw_pos(&self) -> u8 {
52 let rate_u8 = u8::try_from(RATE).expect("RATE is smaller than 256");
53 debug_assert!(self.pos < rate_u8);
54 if self.pos < rate_u8 {
55 self.pos
56 } else {
57 // SAFETY: the type enforces that `pos` is always smaller than `RATE`
58 unsafe { core::hint::unreachable_unchecked() };
59 }
60 }
61
62 /// Get current cursor position as `usize`.
63 #[must_use]

Callers

nothing calls this directly

Calls 1

expectMethod · 0.80

Tested by

no test coverage detected