How to properly move ownership of the data, in an inner loop, so that once the final iteration gets done, the container iterated will be Drop()
ed.
For example:
let left_strs: Vec<String> = Self::allowed(&slice[..i]);
let right_strs: Vec<String> = Self::allowed(&slice[i..]);
for left_str in left_strs{
// how to properly move the ownership of the data here?
for right_str in right_strs.iter(){
ans.push(format!("({}, {})", left_str, right_str));
}
}
Welcome to answer this question in the Stackoverflow if needed