@@ -66,7 +66,7 @@ impl Month {
66
66
/// `m.succ()`: | `February` | `March` | `...` | `January`
67
67
#[ inline]
68
68
#[ must_use]
69
- pub fn succ ( & self ) -> Month {
69
+ pub const fn succ ( & self ) -> Month {
70
70
match * self {
71
71
Month :: January => Month :: February ,
72
72
Month :: February => Month :: March ,
@@ -90,7 +90,7 @@ impl Month {
90
90
/// `m.pred()`: | `December` | `January` | `...` | `November`
91
91
#[ inline]
92
92
#[ must_use]
93
- pub fn pred ( & self ) -> Month {
93
+ pub const fn pred ( & self ) -> Month {
94
94
match * self {
95
95
Month :: January => Month :: December ,
96
96
Month :: February => Month :: January ,
@@ -114,7 +114,7 @@ impl Month {
114
114
/// `m.number_from_month()`: | 1 | 2 | `...` | 12
115
115
#[ inline]
116
116
#[ must_use]
117
- pub fn number_from_month ( & self ) -> u32 {
117
+ pub const fn number_from_month ( & self ) -> u32 {
118
118
match * self {
119
119
Month :: January => 1 ,
120
120
Month :: February => 2 ,
@@ -139,7 +139,7 @@ impl Month {
139
139
/// assert_eq!(Month::January.name(), "January")
140
140
/// ```
141
141
#[ must_use]
142
- pub fn name ( & self ) -> & ' static str {
142
+ pub const fn name ( & self ) -> & ' static str {
143
143
match * self {
144
144
Month :: January => "January" ,
145
145
Month :: February => "February" ,
0 commit comments