johnthagen / rust-belt

:rocket: Asteroids-like arcade game implemented in Rust ✨
73 stars 6 forks source link

Fix rustfmt-nightly and clippy updates CI #156

Closed johnthagen closed 7 years ago

mcdenhoed commented 7 years ago

@johnthagen Any idea why they changed the preferred method of casting?

johnthagen commented 7 years ago

The message in particular talked about silently losing precision in the future or something.

Here is the full error:

error: casting u32 to f64 may become silently lossy if types change
   --> src/menu.rs:189:26
    |
189 |         let menu_align = (window_size.width / 2 - 120) as f64;
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `f64::from((window_size.width / 2 - 120))`
    |
    = help: for further information visit https://github.com/rust-lang-nursery/rust-clippy/wiki#cast_lossless