@@ -270,46 +270,21 @@ cfg_if! {
270270 }
271271}
272272
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-
289273/// Switch something on or off.
290274///
291275/// Convenience enum and wrapper around a bool, which more explicit about the intention to enable
292276/// or disable something, in comparison to `true` or `false`.
293277// TODO: Maybe move to some mod like "util"?
294278#[ derive( Debug , PartialEq , Eq , PartialOrd , Ord , Clone , Copy ) ]
295279#[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
280+ #[ doc( alias = "Toggle" ) ]
296281pub enum Switch {
297282 /// Switch something on / enable a thing.
298283 On ,
299284 /// Switch something off / disable a thing.
300285 Off ,
301286}
302287
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-
313288impl From < Switch > for bool {
314289 fn from ( switch : Switch ) -> Self {
315290 matches ! ( switch, Switch :: On )
0 commit comments