Skip to content

Major structural code refactor - #52

Draft
Oakchris1955 wants to merge 36 commits into
mainfrom
refactor_methods
Draft

Major structural code refactor#52
Oakchris1955 wants to merge 36 commits into
mainfrom
refactor_methods

Conversation

@Oakchris1955

Copy link
Copy Markdown
Owner

With this PR I will attempt to refactor the majority of the code. Changes will be mostly structural, that is, things will mainly get renamed and moved around, but the logic should stay the same. This is being done because the code is mostly spaghetti-like. For example, the fs.rs file of the fat module currently pulls over 50 items from other module and is 2.8k lines long.

Any filesystem-related properties can now be accessed only thought this struct's methods, preventing accidental overwriting of relevant fields

Removed internal `OffsetConversions` trait, its methods are now integrated to the `FSProperties` struct
@Oakchris1955 Oakchris1955 self-assigned this Jul 23, 2026
Oakchris1955 and others added 13 commits July 30, 2026 16:00
…a `Box`ed slice instead of a `Vec` internally
…rectory label was too big

Also updated relevant documentation comments to describe method behaviour if label is too big to fit
I recently stumbled upon rustls' contributing guidelines and one of them was that code on the top of a module should depend on code below it so that everything is more readable and I decided to implement that here
…`unreachable!` and `.then` methods where possible
…nt comment

Co-Authored-By: Marios Mitsios <xrteach@gmail.com>
…r each time where this occured

Also, split a (Sfn, Codepage) tuple into sfn and codepage fields in Properties struct
…ossible

This commit also includes a small rider change where DirEntryChain's len field type has been changed from u16 to EntryCount (EntryCount is a type alias to u16, the change was made to make it more clear where that u16 came from)
@Oakchris1955

Oakchris1955 commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

Removed an assert_eq! I used to debug some stuff.

…add tests

Regarding SFN generation logic, `'` wasn't permitted at all in a SFN while the FAT specification says it does, and mixed-case names that could be directly mapped to their uppercase counterparts were appended with a `~1`. While that behaviour isn't explicitly incorrect, Windows doesn't follow it, so we have adjusted our code to more closely reflect that behaviour.
@Oakchris1955

Oakchris1955 commented Aug 16, 2026

Copy link
Copy Markdown
Owner Author

Had to force push multiple times due to some Git shenanigans when rebasing an older commit.

@Oakchris1955

Copy link
Copy Markdown
Owner Author

5bb3bfd should resolve #14. That said, the unit tests should fail due to how we internally remove directories. I will refactor that and thankfully, the next commit should pass.

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.

1 participant