Closed
Description
The http crate defines constants for common header names, but any use of them triggers this lint:
use http::header::HOST;
use http::HeaderMap;
fn main() {
let map = HeaderMap::new();
println!("{}", map.contains_key(&HOST));
}
error: a const item with interior mutability should not be borrowed
--> src/main.rs:6:38
|
6 | println!("{}", map.contains_key(&HOST));
| ^^^^
|
= note: #[deny(clippy::borrow_interior_mutable_const)] on by default
= help: assign this const to a local or static variable, and use the variable here
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_interior_mutable_const