Use is_some_and
/is_ok_and
in less obvious spots
This commit is contained in:
parent
fb0f74a8c9
commit
307799a711
19 changed files with 53 additions and 88 deletions
|
@ -84,7 +84,7 @@ impl UnstableFeatures {
|
|||
pub fn from_environment(krate: Option<&str>) -> Self {
|
||||
// `true` if this is a feature-staged build, i.e., on the beta or stable channel.
|
||||
let disable_unstable_features =
|
||||
option_env!("CFG_DISABLE_UNSTABLE_FEATURES").map(|s| s != "0").unwrap_or(false);
|
||||
option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some_and(|s| s != "0");
|
||||
// Returns whether `krate` should be counted as unstable
|
||||
let is_unstable_crate =
|
||||
|var: &str| krate.is_some_and(|name| var.split(',').any(|new_krate| new_krate == name));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue