Check if the counter has reached its limit
(&self)
| 50 | } |
| 51 | } |
| 52 | |
| 53 | // Another constructor for a disabled counter |
| 54 | fn new_disabled(name: &'static str, limit: u32) -> Self { |
| 55 | let mut counter = Self::new(name, limit); // Call the primary constructor |
| 56 | counter.enabled = false; |
| 57 | counter |
| 58 | } |