diff options
Diffstat (limited to 'karyons_core/src/utils/decode.rs')
-rw-r--r-- | karyons_core/src/utils/decode.rs | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/karyons_core/src/utils/decode.rs b/karyons_core/src/utils/decode.rs deleted file mode 100644 index a8a6522..0000000 --- a/karyons_core/src/utils/decode.rs +++ /dev/null @@ -1,10 +0,0 @@ -use bincode::Decode; - -use crate::Result; - -/// Decodes a given type `T` from the given slice. returns the decoded value -/// along with the number of bytes read. -pub fn decode<T: Decode>(src: &[u8]) -> Result<(T, usize)> { - let (result, bytes_read) = bincode::decode_from_slice(src, bincode::config::standard())?; - Ok((result, bytes_read)) -} |