Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tools/tidy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub fn git_diff<S: AsRef<OsStr>>(base_commit: &str, extra_arg: S) -> Option<Stri

/// Similar to `files_modified`, but only involves a single call to `git`.
///
/// removes all elements from `items` that do not cause any match when `pred` is called with the list of modifed files.
/// removes all elements from `items` that do not cause any match when `pred` is called with the list of modified files.
///
/// if in CI, no elements will be removed.
pub fn files_modified_batch_filter<T>(
Expand Down
4 changes: 2 additions & 2 deletions src/tools/tidy/src/pal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ fn parse_cfgs(contents: &str) -> Vec<(usize, &str)> {
let contents_after = &contents[*i..];
let first_paren = contents_after.find('(');
let paren_idx = first_paren.map(|ip| i + ip);
let preceeds_whitespace_and_paren = paren_idx
let precedes_whitespace_and_paren = paren_idx
.map(|ip| {
let maybe_space = &contents[*i + "cfg".len()..ip];
maybe_space.chars().all(|c| char::is_whitespace(c) || c == '!')
})
.unwrap_or(false);

succeeds_non_ident && preceeds_whitespace_and_paren
succeeds_non_ident && precedes_whitespace_and_paren
});

cfgs.flat_map(|i| {
Expand Down
Loading