Skip to content
Discussion options

You must be logged in to vote
  1. Buffer implements Deref<Target = [u8]>. You can call buffer.deref() to get a &[u8]. In most cases you can just treat the Buffer as if it were a Vec already.
  2. In nusb 0.2 it's not possible to turn a Vec back into a Buffer any more, so this is no longer a concern. If you want to reuse a buffer you just keep it as a Buffer.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@wangxiaochuTHU
Comment options

Answer selected by wangxiaochuTHU
Comment options

You must be logged in to vote
2 replies
@martinling
Comment options

@wangxiaochuTHU
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants