So some code that used to work broke a couple of days ago. I’m wondering if this is a. by design, b. if someone can point me to the “new rules” on this…
See here:
// Storing and looking up byte strings (e.g. for HTTP)
use std::collections::hash_map::HashMap;
fn main() {
let b: HashMap<Vec<u8>, Vec<u8>> = HashMap::new();
//b.contains_key(b"test"); // ERROR, Used to work fine
//b.contains_key(&b"test"); // ERROR
//b.contains_key(&b"test"[]); // LEGACY WARNING
//b.contains_key(b"test".as_slice()); // LEGACY WARNING
b.contains_key(&b"test"[..]); // OK?
}