Skip to content

Instantly share code, notes, and snippets.

@RandyMcMillan
Forked from rust-play/playground.rs
Created March 31, 2025 12:04
Show Gist options
  • Save RandyMcMillan/38e821688a9673ecc742f537b2432aa8 to your computer and use it in GitHub Desktop.
Save RandyMcMillan/38e821688a9673ecc742f537b2432aa8 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