1 pub struct LipogramCorpora {
2 selections: Vec<(char, Option<String>)>,
6 pub fn validate_all(&mut self) -> Result<(), char> {
7 for selection in &self.selections {
8 if selection.1.is_some() {
9 if selection.1.unwrap().contains(selection.0) {
10 //~^ ERROR cannot move out of `selection.1`
11 return Err(selection.0);
19 pub struct LipogramCorpora2 {
20 selections: Vec<(char, Result<String, String>)>,
23 impl LipogramCorpora2 {
24 pub fn validate_all(&mut self) -> Result<(), char> {
25 for selection in &self.selections {
26 if selection.1.is_ok() {
27 if selection.1.unwrap().contains(selection.0) {
28 //~^ ERROR cannot move out of `selection.1`
29 return Err(selection.0);