Closed mycielski closed 2 years ago
Hey, man! I appreciate the PR, but I have a question for you. When compiling the kernel, after merging your changes, I get a warning about a variable that is made mutable, despite (according to the compiler) having no reason to be mutable. Do you know why this variable is mutable, and if it needs to be mutable?
That's strange. As you can see my commit only changed the way the vector is populated, not its mutability or its usage. Also, I could not replicate the warning. I have tried cargo check
ing and compiler returned no warnings (it does however return warnings and errors on cargo test
, but that's unrelated). I am on nightly-x86_64-pc-windows-msvc
toolchain
In line 56 of src/main.rs there is an inefficient creation and population of a vector. This pull request improves this by creating and populating the vector with iterator collect instead of a for loop which pushes a number onto vector with each iteration. This optimization was originally noticed by reddit user NateReinarWoodwind.