Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created August 20, 2019 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/5071977d265acfeb73ef8dd20cb41754 to your computer and use it in GitHub Desktop.
Save rust-play/5071977d265acfeb73ef8dd20cb41754 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
use bytes::Bytes;
fn main() {
let mut mem = Bytes::from(&b"Hello world"[..]);
println!("{}", std::str::from_utf8(&mem).unwrap());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment