Describe the bug
Last task of the section proposes to use fixedbitset crate, giving incomplete instructions on how to implement a task: the updated code for the constructor is missing.
Even though it's simple to implement, it might be useful to add it into the answer also.
But even if the constructor code is updated, the code provided in the answer does not compile with the latest fixedbitset crate version because:
Apply it to the project (use fixedbitset = "0.1.9")
Compile the project
See compilation error
Expected behavior
There are no compilation errors
Additional context
Have also adjusted bitIsSet to compare the values with === instead of == to make it more safe. The change seems to be too tiny for a separate PR and issue.
Display implementation for Universe is also affected by the bitset usage, but since it's not used at this stage of the tutorial, we might want to add a note that the implementation and render method should be removed as not used.
We might want to explicitly specify the fixedbitset crate version to avoid confusion in the future
Describe the bug Last task of the section proposes to use
fixedbitset
crate, giving incomplete instructions on how to implement a task: the updated code for the constructor is missing. Even though it's simple to implement, it might be useful to add it into the answer also.But even if the constructor code is updated, the code provided in the answer does not compile with the latest
fixedbitset
crate version because:the answer has the code line
pub fn cells(&self) -> *const Cell {
but the bitset crate returns&[u32]
from itsas_slice
method: https://github.com/bluss/fixedbitset/blob/master/src/lib.rs#L200the answer has the code
but does not say how to adjust the
match
statement. It should be done due to bitset returningbool
when accessed by index: https://github.com/bluss/fixedbitset/blob/master/src/lib.rs#L477To Reproduce Steps to reproduce the behavior:
fixedbitset = "0.1.9"
)Expected behavior There are no compilation errors
Additional context
bitIsSet
to compare the values with===
instead of==
to make it more safe. The change seems to be too tiny for a separate PR and issue.Display
implementation for Universe is also affected by thebitset
usage, but since it's not used at this stage of the tutorial, we might want to add a note that the implementation andrender
method should be removed as not used.fixedbitset
crate version to avoid confusion in the future