Merge pull request #545 from reitermarkus/linear-map-borrow

Add test for borrowed `LinearMap` key.
This commit is contained in:
Alex Martens 2025-03-31 13:41:28 +00:00 committed by GitHub
commit 1a33fec858
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -570,6 +570,18 @@ mod test {
static mut _L: LinearMap<i32, i32, 8> = LinearMap::new();
}
#[test]
fn borrow() {
use crate::String;
let mut map = LinearMap::<_, _, 8>::new();
let s = String::<64>::try_from("Hello, world!").unwrap();
map.insert(s, 42).unwrap();
assert_eq!(map.get("Hello, world!").unwrap(), &42);
}
#[test]
fn partial_eq() {
{