(playground)
extern crate reqwest; // 0.10.9
fn main() {
let s = String::from("http://example.com");
const response = reqwest::get(&s);
}
error[E0435]: attempt to use a non-constant value in a constant
--> src/main.rs:5:36
|
5 | const response = reqwest::get(&s);
| ^ non-constant value
I had const response = self.request(...) when I should have had let response = self.request(...) ... too much Javascript.
I don't think I equated "a constant" with const foo = ... in my head, because I'm used to doing const foo = bar(...) in Javascript all the time
It would be nice for the error to point to response as the constant:
5 | const response = reqwest::get(&s);
| ^^^^^^^^ constant ^ non-constant value
(playground)
It would be nice for the error to point to
responseas the constant: