Advertisement
Guest User

Untitled

a guest
May 26th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. let mut slicedAllocated = unsafe {
  2. slice::from_raw_parts(allocated, quoteSize as usize)
  3. };
  4. let encoded_quote = encode(&slicedAllocated);
  5.  
  6.  
  7. The error I get:
  8.  
  9. error[E0277]: the trait bound `[libc::c_void]: std::convert::AsRef<[u8]>` is not satisfied
  10. --> src/main.rs:260:29
  11. |
  12. 260 | let encoded_quote = encode(&slicedAllocated);
  13. | ^^^^^^ the trait `std::convert::AsRef<[u8]>` is not implemented for `[libc::c_void]`
  14. |
  15. = help: the following implementations were found:
  16. <[T; <unevaluated[]>] as std::convert::AsRef<[T]>>
  17. <[T; <unevaluated[]>] as std::convert::AsRef<[T]>>
  18. <[T; <unevaluated[]>] as std::convert::AsRef<[T]>>
  19. <[T; <unevaluated[]>] as std::convert::AsRef<[T]>>
  20. and 30 others
  21. = note: required because of the requirements on the impl of `std::convert::AsRef<[u8]>` for `&[libc::c_void]`
  22. = note: required by `base64::encode`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement