Backport 4326

refactor: rename some private whitelist names
This commit is contained in:
Caleb Cartwright 2020-07-14 00:03:13 -05:00
parent 91995b6142
commit 2d9bc46010
2 changed files with 8 additions and 8 deletions

View file

@ -32,7 +32,7 @@ use crate::utils::{count_newlines, extra_offset, first_line_width, last_line_wid
/// Organized as a list of `(&str, usize)` tuples, giving the name of the macro and the number of
/// arguments before the format string (none for `format!("format", ...)`, one for `assert!(result,
/// "format", ...)`, two for `assert_eq!(left, right, "format", ...)`).
const SPECIAL_MACRO_WHITELIST: &[(&str, usize)] = &[
const SPECIAL_CASE_MACROS: &[(&str, usize)] = &[
// format! like macros
// From the Rust Standard Library.
("eprint!", 0),
@ -60,7 +60,7 @@ const SPECIAL_MACRO_WHITELIST: &[(&str, usize)] = &[
("debug_assert_ne!", 2),
];
const SPECIAL_ATTR_WHITELIST: &[(&str, usize)] = &[
const SPECIAL_CASE_ATTR: &[(&str, usize)] = &[
// From the `failure` crate.
("fail", 0),
];
@ -182,10 +182,10 @@ impl<'a> OverflowableItem<'a> {
}
}
fn whitelist(&self) -> &'static [(&'static str, usize)] {
fn special_cases(&self) -> &'static [(&'static str, usize)] {
match self {
OverflowableItem::MacroArg(..) => SPECIAL_MACRO_WHITELIST,
OverflowableItem::NestedMetaItem(..) => SPECIAL_ATTR_WHITELIST,
OverflowableItem::MacroArg(..) => SPECIAL_CASE_MACROS,
OverflowableItem::NestedMetaItem(..) => SPECIAL_CASE_ATTR,
_ => &[],
}
}
@ -770,7 +770,7 @@ pub(crate) fn maybe_get_args_offset(
) -> Option<(bool, usize)> {
if let Some(&(_, num_args_before)) = args
.get(0)?
.whitelist()
.special_cases()
.iter()
.find(|&&(s, _)| s == callee_str)
{

View file

@ -24,7 +24,7 @@ mod parser;
const DIFF_CONTEXT_SIZE: usize = 3;
// A list of files on which we want to skip testing.
const SKIP_FILE_WHITE_LIST: &[&str] = &[
const FILE_SKIP_LIST: &[&str] = &[
// We want to make sure that the `skip_children` is correctly working,
// so we do not want to test this file directly.
"configs/skip_children/foo/mod.rs",
@ -90,7 +90,7 @@ where
}
fn is_file_skip(path: &Path) -> bool {
SKIP_FILE_WHITE_LIST
FILE_SKIP_LIST
.iter()
.any(|file_path| is_subpath(path, file_path))
}