pineman / fpt

Gameboy emulator (yes, written in rust)
https://pineman.github.io/fpt
MIT License
5 stars 1 forks source link

Decoder #12

Closed joajfreitas closed 11 months ago

pineman commented 11 months ago

@joajfreitas Dear Co-Worker, I hope this message finds thee of good spirits. When can we merge this Pull Request? May I enquire about the scope of this Pull Request? Regards, Code Janitor (professional)

pineman commented 11 months ago

any chance we can move the definitions of Instruction to the instructions.rs file? and rename lib.rs to lr35902.rs? also how idiomatic is it to have all the tests for a file in the same file?

joajfreitas commented 11 months ago

any chance we can move the definitions of Instruction to the instructions.rs file? and rename lib.rs to lr35902.rs? also how idiomatic is it to have all the tests for a file in the same file?

Dear Vice President of Janitorial Activities,

I would incentivize you to indeed move the Instruction structure to is own file. However I would not rename lib.rs as it is of utmost importance to the compilation of our little crate. Alternatively, I would propose moving the LR34902 structure to its own file, similarly to Instruction.

I am unsure of the what is the proper way to structure our tests. I believe it is common to indeed have the tests in the same file as the implementation. This fellow proposes other solutions: https://users.rust-lang.org/t/should-unit-tests-really-be-put-in-the-same-file-as-the-source/62153.

Best Regards, Astronaut Freitas

pineman commented 11 months ago

Dear Sir,

I corroborate your words on the importance of lib.rs. As seen in https://doc.rust-lang.org/book/ch07-01-packages-and-crates.html:

Cargo follows a convention that src/main.rs is the crate root of a binary crate with the same name as the package. Likewise, Cargo knows that if the package directory contains src/lib.rs, the package contains a library crate with the same name as the package, and src/lib.rs is its crate root.

I, myself being a distinguished Inventor as well, have taken upon the most intricate of experiments lately. I ask you to review such new endeavours with careful consideration post-haste, as some may express concerns over the ever-increasing number of branches, especially in a project such as this one, of very young age (it's formality notwithstanding, naturally, my good Sir). You may find the contents of what I'm referring to here.

Regarding tests, let us return to this matter in a future date.