Skip to content

Commit 2d9bc46

Browse files
Backport 4326
refactor: rename some private whitelist names
1 parent 91995b6 commit 2d9bc46

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Diff for: src/overflow.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use crate::utils::{count_newlines, extra_offset, first_line_width, last_line_wid
3232
/// Organized as a list of `(&str, usize)` tuples, giving the name of the macro and the number of
3333
/// arguments before the format string (none for `format!("format", ...)`, one for `assert!(result,
3434
/// "format", ...)`, two for `assert_eq!(left, right, "format", ...)`).
35-
const SPECIAL_MACRO_WHITELIST: &[(&str, usize)] = &[
35+
const SPECIAL_CASE_MACROS: &[(&str, usize)] = &[
3636
// format! like macros
3737
// From the Rust Standard Library.
3838
("eprint!", 0),
@@ -60,7 +60,7 @@ const SPECIAL_MACRO_WHITELIST: &[(&str, usize)] = &[
6060
("debug_assert_ne!", 2),
6161
];
6262

63-
const SPECIAL_ATTR_WHITELIST: &[(&str, usize)] = &[
63+
const SPECIAL_CASE_ATTR: &[(&str, usize)] = &[
6464
// From the `failure` crate.
6565
("fail", 0),
6666
];
@@ -182,10 +182,10 @@ impl<'a> OverflowableItem<'a> {
182182
}
183183
}
184184

185-
fn whitelist(&self) -> &'static [(&'static str, usize)] {
185+
fn special_cases(&self) -> &'static [(&'static str, usize)] {
186186
match self {
187-
OverflowableItem::MacroArg(..) => SPECIAL_MACRO_WHITELIST,
188-
OverflowableItem::NestedMetaItem(..) => SPECIAL_ATTR_WHITELIST,
187+
OverflowableItem::MacroArg(..) => SPECIAL_CASE_MACROS,
188+
OverflowableItem::NestedMetaItem(..) => SPECIAL_CASE_ATTR,
189189
_ => &[],
190190
}
191191
}
@@ -770,7 +770,7 @@ pub(crate) fn maybe_get_args_offset(
770770
) -> Option<(bool, usize)> {
771771
if let Some(&(_, num_args_before)) = args
772772
.get(0)?
773-
.whitelist()
773+
.special_cases()
774774
.iter()
775775
.find(|&&(s, _)| s == callee_str)
776776
{

Diff for: src/test/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mod parser;
2424
const DIFF_CONTEXT_SIZE: usize = 3;
2525

2626
// A list of files on which we want to skip testing.
27-
const SKIP_FILE_WHITE_LIST: &[&str] = &[
27+
const FILE_SKIP_LIST: &[&str] = &[
2828
// We want to make sure that the `skip_children` is correctly working,
2929
// so we do not want to test this file directly.
3030
"configs/skip_children/foo/mod.rs",
@@ -90,7 +90,7 @@ where
9090
}
9191

9292
fn is_file_skip(path: &Path) -> bool {
93-
SKIP_FILE_WHITE_LIST
93+
FILE_SKIP_LIST
9494
.iter()
9595
.any(|file_path| is_subpath(path, file_path))
9696
}

0 commit comments

Comments
 (0)