Closed zubivan closed 4 years ago
hey @zubivan, clippy in the CI sounds great! I have been thinking about anchors as well, I didn't know about them when I started, I think the only downside is that the code would be a little bit less readable if someone were to browse the code samples directly and it's quite the task to do it on all the existing code samples. One idea might be to try to use anchors on any new code and add clippy to the new code samples and slowly migrate the existing code to anchors. Also created #46 .
@iolivia maybe after you'd publish the book. Now it's too much work to fix it up!
sounds good, agreed!
I was thinking to extend the pipeline with clippy action (https://github.com/actions-rs/clippy-check), so we can automatically follow the rust guidelines. As a preparation for that I ran a fixer (cargo --fix) for all the projects. One obvious downside to the fixes removing lines is that the book is using line numbers currently, so those will be affected.
I was reading through mdbook docs and stumbled upon anchors in there, would it be an idea to replace line numbers with those? See (https://rust-lang.github.io/mdBook/format/mdbook.html?highlight=ANCHOR#including-portions-of-a-file). That should make the book quite resilient to even rather big refactorings.
@iolivia what do you think?