3 // Test binary_search_by_key lifetime. Issue #34683
14 Assignment { topic: "abc".into(), partition: 1 }
,
15 Assignment { topic: "def".into(), partition: 2 }
,
16 Assignment { topic: "ghi".into(), partition: 3 }
,
19 let key
: &str = "def";
20 let r
= xs
.binary_search_by_key(&key
, |e
| &e
.topic
);
21 assert_eq
!(Ok(1), r
.map(|i
| i
));