}
}
- fn is_disabled(&self) -> bool {
+ pub 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,
visitor.format_separate_mod(module, &*filemap);
};
- assert_eq!(
+ debug_assert_eq!(
visitor.line_number,
::utils::count_newlines(&format!("{}", visitor.buffer))
);
let mut line_buffer = String::with_capacity(config.max_width() * 2);
let mut is_string = false; // true if the current line contains a string literal.
let mut format_line = config.file_lines().contains_line(name, cur_line);
+ let allow_issue_seek = !issue_seeker.is_disabled();
for (kind, (b, c)) in CharClasses::new(text.chars().enumerate()) {
if c == '\r' {
continue;
}
- if format_line {
+ if allow_issue_seek && format_line {
// Add warnings for bad todos/ fixmes
if let Some(issue) = issue_seeker.inspect(c) {
errors.push(FormattingError {
self.to_string_inner(config, 0)
}
- pub fn to_string_inner(&self, config: &Config, offset: usize) -> Cow<'static, str> {
+ fn to_string_inner(&self, config: &Config, offset: usize) -> Cow<'static, str> {
let (num_tabs, num_spaces) = if config.hard_tabs() {
(self.block_indent / config.tab_spaces(), self.alignment)
} else {