ruff/crates/ruff_python_stdlib/src/future.rs
Charlie Marsh a973019358
Rewrite a variety of .contains() calls as matches! statements (#5432)
## Summary

These have the potential to be much more efficient, as we've seen in the
past.
2023-06-28 22:42:27 -04:00

17 lines
491 B
Rust

/// Returns `true` if `name` is a valid `__future__` feature name, as defined by
/// `__future__.all_feature_names`.
pub fn is_feature_name(name: &str) -> bool {
matches!(
name,
"nested_scopes"
| "generators"
| "division"
| "absolute_import"
| "with_statement"
| "print_function"
| "unicode_literals"
| "barry_as_FLUFL"
| "generator_stop"
| "annotations"
)
}