Regarding the scripts
folder, and coding style peculiarities
#13
Replies: 1 comment 1 reply
-
I don't want to a a whole code review, I just peeked into it to get a rough idea of what you're doing, and I noticed a few unusual things. Maybe they are intentional, maybe not, so I figured I'd ask. In a lot of source files, there is redundant whitespace (as in, more than one empty line). Examples:
That is why I was wondering if a lot of the code was auto-generated, that usually happens to me when I have code that is auto-generated. Another thing I have noticed is hex constants in places, not sure where they come from. Might make sense to give them a name, as in define a const?
In a lot of places, the formatting seems a bit off. Like there being spaces after "Some" or before opening parenthesis. I think you should consider running the code base through cargo fmt. Finally, one thing that I found makes it hard to follow the code is importing the prelude in files. Usually, when I write crates I will try to always import everything I'm using explicitly. This makes it easier to see where things come from (example: I was trying to see what the Rb type was in the code you had linked, but instead of seeing it directly imported from memory.rs, I had to follow through the prelude). I would recommend not internally using a prelude, offering it only to other crates linking against yours. But I suppose this is opinionated. Cheers, |
Beta Was this translation helpful? Give feedback.
-
In reply to @xfbs on issue #12
With regard the
scripts
folder: that's my own personal console-based IDE customized for this project, based on another tool of my own, z-run. :)In essence I use them to build, test, release, generate some non-essential files, grep the sources for problematic lines, etc.
However, they are absolutenly not required for building the tool. One can just go in the
sources
folder and runcargo build --release
without any issues.Could you elaborate more on this?
Beta Was this translation helpful? Give feedback.
All reactions