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.
This commit is contained in:
Alona Enraght-Moony
2026-04-02 21:03:25 +00:00
parent e6b64a2f4c
commit e469da4f84
+6 -6
View File
@@ -41,15 +41,15 @@ fn is_simple_cfg(cfg: &CfgEntry) -> bool {
}
}
/// Returns `false` if is `Any`, otherwise returns `true`.
fn is_all_cfg(cfg: &CfgEntry) -> bool {
/// Returns `true` if is [`CfgEntry::Any`], otherwise returns `false`.
fn is_any_cfg(cfg: &CfgEntry) -> bool {
match cfg {
CfgEntry::Bool(..)
| CfgEntry::NameValue { .. }
| CfgEntry::Not(..)
| CfgEntry::Version(..)
| CfgEntry::All(..) => true,
CfgEntry::Any(..) => false,
| CfgEntry::All(..) => false,
CfgEntry::Any(..) => true,
}
}
@@ -370,7 +370,7 @@ fn display_sub_cfgs(
} else {
Either::Right(
Wrapped::with_parens()
.when(!is_all_cfg(sub_cfg))
.when(is_any_cfg(sub_cfg))
.wrap(Display(sub_cfg, self.1)),
)
}
@@ -394,7 +394,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
.iter()
.map(|sub_cfg| {
Wrapped::with_parens()
.when(!is_all_cfg(sub_cfg))
.when(is_any_cfg(sub_cfg))
.wrap(Display(sub_cfg, self.1))
})
.joined(separator, fmt)