3 pub struct LipogramCorpora {
4 selections: Vec<(char, Option<String>)>,
8 pub fn validate_all(&mut self) -> Result<(), char> {
9 for selection in &self.selections {
10 if selection.1.is_some() {
11 if selection.1.unwrap().contains(selection.0) {
12 //~^ ERROR cannot move out of `selection.1`
13 return Err(selection.0);
21 pub struct LipogramCorpora2 {
22 selections: Vec<(char, Result<String, String>)>,
25 impl LipogramCorpora2 {
26 pub fn validate_all(&mut self) -> Result<(), char> {
27 for selection in &self.selections {
28 if selection.1.is_ok() {
29 if selection.1.unwrap().contains(selection.0) {
30 //~^ ERROR cannot move out of `selection.1`
31 return Err(selection.0);