File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,10 @@ pub mod examples;
143143/// upper bound can be inclusive (`x..=y`) or exclusive (`x..y`). The attributes and visibility
144144/// (e.g. `pub`) of the type are forwarded directly to the output type.
145145///
146+ /// If the type is a struct and the bounded integer's range does not include zero,
147+ /// the struct will have a niche at zero,
148+ /// allowing for `Option<BoundedInteger>` to be the same size as `BoundedInteger` itself.
149+ ///
146150/// See the [`examples`] module for examples of what this macro generates.
147151///
148152/// # Examples
Original file line number Diff line number Diff line change @@ -690,7 +690,7 @@ macro_rules! define_bounded_integers {
690690 #[ cfg_attr( doc_cfg, doc( cfg( feature = "step_trait" ) ) ) ]
691691 impl <const MIN : Inner , const MAX : Inner > iter:: Step for Bounded <MIN , MAX > {
692692 #[ inline]
693- fn steps_between( start: & Self , end: & Self ) -> Option <usize > {
693+ fn steps_between( start: & Self , end: & Self ) -> ( usize , Option <usize >) {
694694 iter:: Step :: steps_between( & start. get( ) , & end. get( ) )
695695 }
696696 #[ inline]
You can’t perform that action at this time.
0 commit comments