mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user