refactor: modularize files and refactor existing implementations - #438
Open
alejandro-vaz wants to merge 8 commits into
Open
refactor: modularize files and refactor existing implementations#438alejandro-vaz wants to merge 8 commits into
alejandro-vaz wants to merge 8 commits into
Conversation
alejandro-vaz
marked this pull request as ready for review
August 24, 2026 12:29
zachs18
reviewed
Aug 25, 2026
Comment on lines
+6
to
+7
| blank_lines_lower_bound = 0 | ||
| blank_lines_upper_bound = 0 |
Contributor
There was a problem hiding this comment.
I don't think removing all blank lines improves readability; I think it makes it worse. Also note that servo/servo doesn't do this (example)
Collaborator
Author
There was a problem hiding this comment.
fair
then probably 0 for lower bound and 1 for upper I guess. 2+ looks weird to me
did it out of inertia, didn't think much about it, I'll fix it tomorrow
code looks weird though now that you're saying it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR is the preliminary implementation of #427
scope of this PR
this PR aims to refactor the codebase to make it navigable
it starts to split the old 3k LOC
lib.rsinto small submodules based on abstraction boundaries:allocationerror.rs=> error typesbytes.rs=> functionality provided by thebytescrate, gated by a cfgcomparisons.rs=>EqandOrd, total and partiallib.rs=> remaining not-yet-refactored codemallocsizeof.rs=>MallocSizeOfwork gated behind a cfgrawsmallvec.rs=> already implemented by @zachs18 on MakeRawSmallVec(and its fields) public only underfeature = "internals". (v2) #348references.rs=> asref, borrow, deref. for const and mut referencesserde.rs=> serde's serialize and deserialize gated behind a cfgstd.rs=> standard library implementations. currently, onlystd::io::Writetaggedlen.rs=>TaggedLenand its implementationtests.rs=> tests, already present beforeother changes
CollectionAllocErrtoAllocationErroris_zst<T>()helper which can be inlined by a simple comparisonrustfmt.tomla bit to group imports and removed the use of thevec!macro so the formatter didn't get confused about whether it was referencing thevecmodule or thevec!macroNote
documentation doesn't build properly, see #439
Note
experimented a bit with
rustfmt.toml, should make files easier to read now