]> git.lizzy.rs Git - rust.git/commitdiff
Do not inspect code for issues or todos when not required
authortopecongiro <seuchida@gmail.com>
Sun, 18 Feb 2018 09:13:46 +0000 (18:13 +0900)
committertopecongiro <seuchida@gmail.com>
Mon, 19 Feb 2018 03:52:40 +0000 (12:52 +0900)
rustfmt-core/src/issues.rs

index 353f8349d2a15ef624782d632e059925638d7c9b..fc04c1331972e3c9c5b777d92e78c84b5123efc3 100644 (file)
@@ -93,9 +93,17 @@ pub fn new(report_todo: ReportTactic, report_fixme: ReportTactic) -> BadIssueSee
         }
     }
 
+    fn is_disabled(&self) -> bool {
+        !is_enabled(self.report_todo) && !is_enabled(self.report_fixme)
+    }
+
     // Check whether or not the current char is conclusive evidence for an
     // unnumbered TO-DO or FIX-ME.
     pub fn inspect(&mut self, c: char) -> Option<Issue> {
+        if self.is_disabled() {
+            return None;
+        }
+
         match self.state {
             Seeking::Issue {
                 todo_idx,