Created
June 3, 2022 12:28
-
-
Save kriogenia/33a8c90ae2003db5f8caeb69ab7aa348 to your computer and use it in GitHub Desktop.
include_str and include_bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TOKEN_AS_STR: &'static str = include_str!("./token.txt"); | |
const TOKEN_AS_BYTES: &[u8] = include_bytes!("./token.txt"); | |
fn main() { | |
assert_eq!("HelLoWoRLd", TOKEN_AS_STR); | |
assert_eq!("HelLoWoRLd".as_bytes(), TOKEN_AS_BYTES); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment