@@ -270,46 +270,21 @@ cfg_if! {
270
270
}
271
271
}
272
272
273
- /// Toggle something on or off.
274
- ///
275
- /// Convenience enum and wrapper around a bool, which more explicit about the intention to enable
276
- /// or disable something, in comparison to `true` or `false`.
277
- // TODO: Maybe move to some mod like "util"?
278
- #[ derive( Debug , PartialEq , Eq , PartialOrd , Ord , Clone , Copy ) ]
279
- #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
280
- #[ deprecated( since = "0.10.0" , note = "Use Switch instead" ) ]
281
- #[ allow( deprecated) ]
282
- pub enum Toggle {
283
- /// Toggle something on / enable a thing.
284
- On ,
285
- /// Toggle something off / disable a thing.
286
- Off ,
287
- }
288
-
289
273
/// Switch something on or off.
290
274
///
291
275
/// Convenience enum and wrapper around a bool, which more explicit about the intention to enable
292
276
/// or disable something, in comparison to `true` or `false`.
293
277
// TODO: Maybe move to some mod like "util"?
294
278
#[ derive( Debug , PartialEq , Eq , PartialOrd , Ord , Clone , Copy ) ]
295
279
#[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
280
+ #[ doc( alias = "Toggle" ) ]
296
281
pub enum Switch {
297
282
/// Switch something on / enable a thing.
298
283
On ,
299
284
/// Switch something off / disable a thing.
300
285
Off ,
301
286
}
302
287
303
- #[ allow( deprecated) ]
304
- impl From < Toggle > for Switch {
305
- fn from ( toggle : Toggle ) -> Self {
306
- match toggle {
307
- Toggle :: On => Switch :: On ,
308
- Toggle :: Off => Switch :: Off ,
309
- }
310
- }
311
- }
312
-
313
288
impl From < Switch > for bool {
314
289
fn from ( switch : Switch ) -> Self {
315
290
matches ! ( switch, Switch :: On )
0 commit comments