/rust/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-0.23.37/src/polyfill.rs
Line | Count | Source |
1 | | /// Non-panicking `let (nonce, ciphertext) = ciphertext.split_at(...)`. |
2 | | // TODO(XXX): remove once MSRV reaches 1.80 |
3 | | #[allow(dead_code)] // Complicated conditional compilation guards elided |
4 | 0 | pub(crate) fn try_split_at(slice: &[u8], mid: usize) -> Option<(&[u8], &[u8])> { |
5 | 0 | match mid > slice.len() { |
6 | 0 | true => None, |
7 | 0 | false => Some(slice.split_at(mid)), |
8 | | } |
9 | 0 | } Unexecuted instantiation: rustls::polyfill::try_split_at Unexecuted instantiation: rustls::polyfill::try_split_at |