Last active
June 2, 2023 10:40
-
-
Save kriogenia/d9cc1b6bd71f99d4a371329074beb321 to your computer and use it in GitHub Desktop.
Attempt to define as constant a non-const
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 ADDRESSES: Vec<&str> = Vec::from([ | |
"http://validaddress.com", | |
"http://mainmirror.com", | |
"http://128.0.0.1:1337" | |
]); | |
fn main() { | |
check_addresses() | |
} | |
fn check_addresses() { | |
assert_eq!("http://validaddress.com", ADDRESSES[0]); | |
println!("The address list is readable and correct: {:?}", ADDRESSES) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment