pub fn decompress(src: &[u8], dst: &mut [u8]) -> Result<usize, String> {
    unsafe {
        let mut dst_len = 0;
        snappy_uncompressed_length(
            src.as_ptr(),
            src.len() as size_t,
            &mut dst_len,
        );
        if dst.len() < dst_len {
            return Err(format!(
                "destination buffer too small ({} < {})",
                dst.len(),
                dst_len
            ));
        }
        let r = snappy_uncompress(
            src.as_ptr(),
            src.len(),
            dst.as_mut_ptr(),
            &mut dst_len,
        );
        if r == 0 {
            Ok(dst_len)
        } else {
            Err("snappy: invalid input".to_owned())
        }
    }
}
Decompress the bytes in `src` into `dst`. `dst` must be big enough to
hold the the uncompressed size of the bytes in `src`.

If there was a problem decompressing `src`, an error is returned.
snappy-cpp/src/lib.rs