Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created March 31, 2025 12:04
Show Gist options
  • Save rust-play/23e03fc9d2078417bbea9027a3f195c3 to your computer and use it in GitHub Desktop.
Save rust-play/23e03fc9d2078417bbea9027a3f195c3 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
use std::str;
fn main() {
let self_bytes: &[u8] = include_bytes!("main.rs");
match str::from_utf8(self_bytes) {
Ok(s) => println!("{}", s),
Err(e) => println!("Error: {}", e),
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment