8000 Miscellaneous Code Cleanups by TheLostLambda · Pull Request #915 · aerynOS/os-tools · GitHub
[go: up one dir, main page]

Skip to content

Miscellaneous Code Cleanups - #915

Open
TheLostLambda wants to merge 3 commits into
aerynOS:mainfrom
TheLostLambda:misc-cleanups
Open

TheLostLambda wants to merge 3 commits into
aerynOS:mainfrom
TheLostLambda:misc-cleanups

Conversation

@TheLostLambda
Copy link
Copy Markdown

Here are some things I've encountered whilst experimenting in #914!

That PR is built on top of this one, and this one is ready to merge whenever.

These commits are conceptually unrelated to the lib/cli split.

@jplatte jplatte left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re. third commit, there's a clippy lint you can enable to enforce this (there is also one for the other way around, if one prefers mod.rs). And while mod.rs is the older style in the sense that it's been supported for longer, there is no consensus in the Rust community as to which one is better.

Comment thread crates/vfs/src/tree/builder.rs Resolved
Comment thread boulder/src/cli.rs
}

// TODO: Box errors consistently throughout the codebase so that this can be removed
#[expect(clippy::result_large_err)]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I would just allow this via workspace.lints.clippy. Probably not that big of a deal.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that could be reasonable, though perhaps it's worth seeing what some others think here? @ermo and @tarkah ?

I'm often hesitant to allow lints for a whole project, but I could be talked into it here, probably.

I also updated the version of `typos-cli` used in the CI, and fixed the
one new "typo" it identified.
I tried boxing some of the error variants, but it ended up being a
really messy mix of boxed and non-boxed `Error`s. I think that, to solve
this issue properly, we need to pull the `BoxedError` type out into its
own crate that's shared with `boulder`, before systematically converting
existing `Error`s to it somehow...
Apparently using `mod.rs` files is the older way of doing things. I
noticed that the `event.rs` module was using the newer style, so I've
brought the rest of the repo up to date!

https://doc.rust-lang.org/book/ch07-05-separating-modules-into-different-files.html#alternate-file-paths

This is a bit tangential to the rest of my refactor work, so I'm happy
to split it out into a different PR.
@TheLostLambda
TheLostLambda commented Nov 11, 2026 •
Copy link
Copy Markdown
Author

Thanks for the review, @jplatte !

I've integrated your suggestions for commits 1 and 3, but I'm still waiting to see what people think about globally allowing that result_large_err lint!

As for the mod.rs or no mod.rs style, I do think I agree with the reasoning given in the Rust book (https://doc.rust-lang.org/book/ch07-05-separating-modules-into-different-files.html#alternate-file-paths): having a lot of mod.rs-named files makes them harder to keep track of in a text editor. I am open to the opinions of others, of course! I just want one standard or the other enforced by Clippy (thanks for that tip!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0