3 // Encountered e.g. an IO error.
4 has_operational_errors: bool,
6 // Failed to reformat code because of parsing errors.
7 has_parsing_errors: bool,
9 // Code is valid, but it is impossible to format it properly.
10 has_formatting_errors: bool,
14 pub fn new() -> Summary {
16 has_operational_errors: false,
17 has_parsing_errors: false,
18 has_formatting_errors: false,
22 pub fn has_operational_errors(&self) -> bool {
23 self.has_operational_errors
26 pub fn has_parsing_errors(&self) -> bool {
27 self.has_parsing_errors
30 pub fn has_formatting_errors(&self) -> bool {
31 self.has_formatting_errors
34 pub fn add_operational_error(&mut self) {
35 self.has_operational_errors = true;
38 pub fn add_parsing_error(&mut self) {
39 self.has_parsing_errors = true;
42 pub fn add_formatting_error(&mut self) {
43 self.has_formatting_errors = true;
46 pub fn has_no_errors(&self) -> bool {
47 !(self.has_operational_errors || self.has_parsing_errors || self.has_formatting_errors)
50 pub fn add(&mut self, other: Summary) {
51 self.has_operational_errors |= other.has_operational_errors;
52 self.has_formatting_errors |= other.has_formatting_errors;
53 self.has_parsing_errors |= other.has_parsing_errors;