rust-lang / rustlings

:crab: Small exercises to get you used to reading and writing Rust code!
https://rustlings.cool
MIT License
53.83k stars 10.13k forks source link

as_ref_mut.rs weird error using provided solution #2051

Closed DaQue closed 3 months ago

DaQue commented 3 months ago

I copied the solution and pasted it over my solution because I kept getting an odd error and I still get this error:

error[E0277]: cannot divide f64 by usize --> exercises/23_conversions/using_as.rs:8:11 8 total / values.len() ^ no implementation for f64 / usize

= help: the trait Div<usize> is not implemented for f64 = help: the following other types implement trait Div<Rhs>:

> <&'a f64 as Div> <&f64 as Div<&f64>> For more information about this error, try `rustc --explain E0277`. error: could not compile `exercises` (bin "using_as") due to 1 previous error It doesn't even match line 8 which is just "}".
mo8it commented 3 months ago

The feedback that you get is not about the exercise as_ref_mut but about using_as (shown in the path exercises/23_conversions/using_as.rs:8:11 and at the end bin "using_as").