Skip to content

Commit 325340e

Browse files
authored
Rollup merge of #154728 - aDotInTheVoid:doc-cfgz-nuts-gotem, r=GuillaumeGomez
rustdoc: Improve internal function name This functions name totally contradicted what it did. And the only places it was used immediatly `!`ed it. Push the `!` into the function, and rename it to make sense. Should hopefully result in less head-scratching next time someone looks at this. r? @GuillaumeGomez
2 parents 6f336f9 + e469da4 commit 325340e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/librustdoc/clean/cfg.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ fn is_simple_cfg(cfg: &CfgEntry) -> bool {
4141
}
4242
}
4343

44-
/// Returns `false` if is `Any`, otherwise returns `true`.
45-
fn is_all_cfg(cfg: &CfgEntry) -> bool {
44+
/// Returns `true` if is [`CfgEntry::Any`], otherwise returns `false`.
45+
fn is_any_cfg(cfg: &CfgEntry) -> bool {
4646
match cfg {
4747
CfgEntry::Bool(..)
4848
| CfgEntry::NameValue { .. }
4949
| CfgEntry::Not(..)
5050
| CfgEntry::Version(..)
51-
| CfgEntry::All(..) => true,
52-
CfgEntry::Any(..) => false,
51+
| CfgEntry::All(..) => false,
52+
CfgEntry::Any(..) => true,
5353
}
5454
}
5555

@@ -370,7 +370,7 @@ impl Display<'_> {
370370
} else {
371371
Either::Right(
372372
Wrapped::with_parens()
373-
.when(!is_all_cfg(sub_cfg))
373+
.when(is_any_cfg(sub_cfg))
374374
.wrap(Display(sub_cfg, self.1)),
375375
)
376376
}
@@ -394,7 +394,7 @@ impl fmt::Display for Display<'_> {
394394
.iter()
395395
.map(|sub_cfg| {
396396
Wrapped::with_parens()
397-
.when(!is_all_cfg(sub_cfg))
397+
.when(is_any_cfg(sub_cfg))
398398
.wrap(Display(sub_cfg, self.1))
399399
})
400400
.joined(separator, fmt)

0 commit comments

Comments
 (0)