@@ -4545,13 +4545,8 @@ macro_rules! try_from_unbounded {
4545
4545
type Error = TryFromIntError ;
4546
4546
4547
4547
/// Try to create the target number type from a source
4548
- /// number type. If the source type has a larger range
4549
- /// than the target, or their ranges are disjoint (such
4550
- /// as converting a signed to unsigned number or vice
4551
- /// versa), this will return `None` if the source value
4552
- /// doesn't fit into the range of the destination value.
4553
- /// If the conversion can never fail, this is still
4554
- /// implemented for completeness's sake.
4548
+ /// number type. This returns an error if the source value
4549
+ /// is outside of the range of the target type.
4555
4550
#[ inline]
4556
4551
fn try_from( value: $source) -> Result <Self , Self :: Error > {
4557
4552
Ok ( value as $target)
@@ -4568,13 +4563,8 @@ macro_rules! try_from_lower_bounded {
4568
4563
type Error = TryFromIntError ;
4569
4564
4570
4565
/// Try to create the target number type from a source
4571
- /// number type. If the source type has a larger range
4572
- /// than the target, or their ranges are disjoint (such
4573
- /// as converting a signed to unsigned number or vice
4574
- /// versa), this will return `None` if the source value
4575
- /// doesn't fit into the range of the destination value.
4576
- /// If the conversion can never fail, this is still
4577
- /// implemented for completeness's sake.
4566
+ /// number type. This returns an error if the source value
4567
+ /// is outside of the range of the target type.
4578
4568
#[ inline]
4579
4569
fn try_from( u: $source) -> Result <$target, TryFromIntError > {
4580
4570
if u >= 0 {
@@ -4595,13 +4585,8 @@ macro_rules! try_from_upper_bounded {
4595
4585
type Error = TryFromIntError ;
4596
4586
4597
4587
/// Try to create the target number type from a source
4598
- /// number type. If the source type has a larger range
4599
- /// than the target, or their ranges are disjoint (such
4600
- /// as converting a signed to unsigned number or vice
4601
- /// versa), this will return `None` if the source value
4602
- /// doesn't fit into the range of the destination value.
4603
- /// If the conversion can never fail, this is still
4604
- /// implemented for completeness's sake.
4588
+ /// number type. This returns an error if the source value
4589
+ /// is outside of the range of the target type.
4605
4590
#[ inline]
4606
4591
fn try_from( u: $source) -> Result <$target, TryFromIntError > {
4607
4592
if u > ( <$target>:: max_value( ) as $source) {
@@ -4622,13 +4607,8 @@ macro_rules! try_from_both_bounded {
4622
4607
type Error = TryFromIntError ;
4623
4608
4624
4609
/// Try to create the target number type from a source
4625
- /// number type. If the source type has a larger range
4626
- /// than the target, or their ranges are disjoint (such
4627
- /// as converting a signed to unsigned number or vice
4628
- /// versa), this will return `None` if the source value
4629
- /// doesn't fit into the range of the destination value.
4630
- /// If the conversion can never fail, this is still
4631
- /// implemented for completeness's sake.
4610
+ /// number type. This returns an error if the source value
4611
+ /// is outside of the range of the target type.
4632
4612
#[ inline]
4633
4613
fn try_from( u: $source) -> Result <$target, TryFromIntError > {
4634
4614
let min = <$target>:: min_value( ) as $source;
0 commit comments