From 002ea77d28dfa18b7726bcae8a5ffed623058deb Mon Sep 17 00:00:00 2001 From: Max Audron Date: Thu, 30 Apr 2020 12:30:11 +0200 Subject: cleanup --- src/util.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/util.rs') diff --git a/src/util.rs b/src/util.rs index dd87f7f..192e270 100644 --- a/src/util.rs +++ b/src/util.rs @@ -19,6 +19,7 @@ macro_rules! match_variant { }; } +/// Prepend the length of `buf` to `buf` pub fn prepend_byte_len(buf: &mut Vec) { use std::convert::TryInto; let len: i32 = buf.len().try_into().unwrap(); @@ -29,6 +30,7 @@ pub fn prepend_byte_len(buf: &mut Vec) { buf.insert(0, ulen[0]); } +/// Insert a bytes `input` into `buf` at position `pos` pub fn insert_bytes(pos: usize, buf: &mut Vec, input: &mut [u8]) { input.reverse(); for i in input { -- cgit v1.2.3