Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion library/core/src/convert/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ impl_from! { f32, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0"
#[stable(feature = "float_from_bool", since = "1.68.0")]
#[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")]
impl const From<bool> for f32 {
/// Converts `bool` to `f32` losslessly.
/// Converts `bool` to `f32` losslessly. The resulting value is `0.0` for
/// `false` and `1.0` for `true` values.
#[inline]
fn from(small: bool) -> Self {
small as u8 as Self
Expand Down