Skip to content

Commit 8c3bdcc

Browse files
author
Clar Charr
committed
Add From<bool> for int types
1 parent aa094a4 commit 8c3bdcc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: src/libcore/num/mod.rs

+14
Original file line numberDiff line numberDiff line change
@@ -4454,6 +4454,20 @@ macro_rules! impl_from {
44544454
}
44554455
}
44564456

4457+
// Bool -> Any
4458+
impl_from! { bool, u8, #[stable(feature = "from_bool", since = "1.28.0")] }
4459+
impl_from! { bool, u16, #[stable(feature = "from_bool", since = "1.28.0")] }
4460+
impl_from! { bool, u32, #[stable(feature = "from_bool", since = "1.28.0")] }
4461+
impl_from! { bool, u64, #[stable(feature = "from_bool", since = "1.28.0")] }
4462+
impl_from! { bool, u128, #[stable(feature = "from_bool", since = "1.28.0")] }
4463+
impl_from! { bool, usize, #[stable(feature = "from_bool", since = "1.28.0")] }
4464+
impl_from! { bool, i8, #[stable(feature = "from_bool", since = "1.28.0")] }
4465+
impl_from! { bool, i16, #[stable(feature = "from_bool", since = "1.28.0")] }
4466+
impl_from! { bool, i32, #[stable(feature = "from_bool", since = "1.28.0")] }
4467+
impl_from! { bool, i64, #[stable(feature = "from_bool", since = "1.28.0")] }
4468+
impl_from! { bool, i128, #[stable(feature = "from_bool", since = "1.28.0")] }
4469+
impl_from! { bool, isize, #[stable(feature = "from_bool", since = "1.28.0")] }
4470+
44574471
// Unsigned -> Unsigned
44584472
impl_from! { u8, u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
44594473
impl_from! { u8, u32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }

0 commit comments

Comments
 (0)