Skip to content

Commit a8dd30c

Browse files
committed
No need to to use consts for rulesets we only use in one place
1 parent 0621ce0 commit a8dd30c

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

src/rulesets/ty_based.rs

+14-19
Original file line numberDiff line numberDiff line change
@@ -439,13 +439,6 @@ impl RuleOptions {
439439
..RuleOptions::STABLE_RUST
440440
};
441441

442-
/// A backwards-compatible proposal by @dianne that behaves close to the 2024 stateless
443-
/// proposal.
444-
pub const EAT_OUTER_2021: Self = RuleOptions {
445-
fallback_to_outer: FallbackToOuterBehavior::EatBoth,
446-
..RuleOptions::STATELESS_2021
447-
};
448-
449442
/// Purely structural matching, with no match ergonomics.
450443
pub const STRUCTURAL: Self = RuleOptions {
451444
inherited_ref_on_ref: InheritedRefOnRefBehavior::Error,
@@ -456,14 +449,6 @@ impl RuleOptions {
456449
..Self::STATELESS
457450
};
458451

459-
/// The minimal amout of match ergonomics that's forward-compatible with most proposals.
460-
pub const MIN_ERGONOMICS: Self = RuleOptions {
461-
ref_binding_on_inherited: RefBindingOnInheritedBehavior::Error,
462-
mut_binding_on_inherited: MutBindingOnInheritedBehavior::Error,
463-
match_constructor_through_ref: true,
464-
..Self::STRUCTURAL
465-
};
466-
467452
pub const RFC3627_2021: Self = RuleOptions {
468453
mut_binding_on_inherited: MutBindingOnInheritedBehavior::ResetBindingMode,
469454
inherited_ref_on_ref: InheritedRefOnRefBehavior::EatBoth,
@@ -523,12 +508,17 @@ pub static KNOWN_TY_BASED_BUNDLES: &[BundleDoc<RuleOptions>] = &[
523508
BundleDoc {
524509
name: "stateless_2021",
525510
ruleset: RuleOptions::STATELESS_2021,
526-
doc: "The currently-planned version of the `stateless` ruleset for edition 2021. Not actually stateless.",
511+
doc: "The currently-planned version of the `stateless` ruleset for edition 2021. \
512+
Not actually stateless.",
527513
},
528514
BundleDoc {
529515
name: "eat_outer_2021",
530-
ruleset: RuleOptions::EAT_OUTER_2021,
531-
doc: "A backwards-compatible proposal by @dianne that behaves close to the 2024 stateless proposal.",
516+
ruleset: RuleOptions {
517+
fallback_to_outer: FallbackToOuterBehavior::EatBoth,
518+
..RuleOptions::STATELESS_2021
519+
},
520+
doc: "A backwards-compatible proposal by @dianne that behaves close to the\
521+
2024 stateless proposal.",
532522
},
533523
BundleDoc {
534524
name: "rfc3627",
@@ -552,7 +542,12 @@ pub static KNOWN_TY_BASED_BUNDLES: &[BundleDoc<RuleOptions>] = &[
552542
},
553543
BundleDoc {
554544
name: "min_ergonomics",
555-
ruleset: RuleOptions::MIN_ERGONOMICS,
545+
ruleset: RuleOptions {
546+
ref_binding_on_inherited: RefBindingOnInheritedBehavior::Error,
547+
mut_binding_on_inherited: MutBindingOnInheritedBehavior::Error,
548+
match_constructor_through_ref: true,
549+
..RuleOptions::STRUCTURAL
550+
},
556551
doc: "The minimal amout of match ergonomics that's forward-compatible with most proposals",
557552
},
558553
BundleDoc {

0 commit comments

Comments
 (0)