Open
Description
struct S {
v: Vec<(u32, Vec<u32>)>,
}
impl S {
pub fn remove(&mut self, i: u32) -> Option<std::vec::Drain<u32>> {
self.v.get_mut(i as _).map(|&mut (_, ref mut v2)| {
v2.drain(..)
})
}
}
Errors with:
error: the type of this value must be known in this context
--> src/main.rs:8:16
|
8 | v2.drain(..)
| ^^^^^
I'm not sure which value the error is pointing at here. The fix here is to explicitly specify the type we want to cast i
into.