Skip to content

Commit 9b8a234

Browse files
authored
Fix warnings in rustc nightly due to introduction of From<f16> for f32 (#23971)
# Objective There's a new warning for code that uses literals with `Into<f32>` because the compiler can no longer infer that the literal should be an `f32` after `From<f16> for f32` was introduced. See: rust-lang/rust#154024 ## Solution Explicit `f32` literals. ## Note This behavior might make `Into<f32>` arguments inconvenient in the future.
1 parent 90b4154 commit 9b8a234

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

crates/bevy_ui/src/layout/convert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl Val {
3131

3232
fn into_length_percentage(self, context: &LayoutContext) -> taffy::style::LengthPercentage {
3333
match self {
34-
Val::Auto => style_helpers::length(0.),
34+
Val::Auto => style_helpers::length(0.0_f32),
3535
Val::Percent(value) => style_helpers::percent(value / 100.),
3636
Val::Px(value) => style_helpers::length(context.scale_factor * value),
3737
Val::VMin(value) => {

crates/bevy_ui/src/layout/ui_surface.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ impl UiSurface {
182182
// Note: Taffy percentages are floats ranging from 0.0 to 1.0.
183183
// So this is setting width:100% and height:100%
184184
size: taffy::geometry::Size {
185-
width: taffy::style_helpers::percent(1.0),
186-
height: taffy::style_helpers::percent(1.0),
185+
width: taffy::style_helpers::percent(1.0_f32),
186+
height: taffy::style_helpers::percent(1.0_f32),
187187
},
188188
align_items: Some(taffy::style::AlignItems::Start),
189189
justify_items: Some(taffy::style::JustifyItems::Start),

0 commit comments

Comments
 (0)