We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef3af14 commit 959d981Copy full SHA for 959d981
runtime/src/precompiles/mod.rs
@@ -233,6 +233,14 @@ fn dispatch(
233
}
234
235
236
+/// Retrieves a single u8 value from the given data slice at the specified index.
237
+///
238
+/// # Args
239
+/// * `data`: The slice of bytes from which to retrieve the u8 value.
240
+/// * `index`: The index within the `data` slice where the u8 value is located.
241
242
+/// # Returns
243
+/// A `Result` containing the u8 value at the specified index if successful, or a `PrecompileFailure` if the index is out of range.
244
pub fn get_single_u8(data: &[u8], index: usize) -> Result<u8, PrecompileFailure> {
245
if let Some(result) = data.get(index) {
246
Ok(*result)
0 commit comments