Refactor codebase to use indexset for nicer developer ergonomics #2

Merged
dan merged 3 commits from refactor-indexset into main 2025-11-27 16:21:33 +01:00
Owner

This PR refactors the codebase to use IndexSet<String> for all "set-like" fields on ComicInfo structs. It contributes a macro that is used in said structs, which generates a variety of convenience functions.

This PR refactors the codebase to use `IndexSet<String>` for all "set-like" fields on `ComicInfo` structs. It contributes a macro that is used in said structs, which generates a variety of convenience functions.
This commit fixes serialization of enumerations and bools by providing
custom implementations, either through serde's `serialize_with` or by
simply `impl Serialize for SomeEnum`.

It also moves serialization helpers into its own file, as opposed to
directly in `lib.rs`.
This is part of a series of commits to refactor the internals of the
crate to be more ergonomic for the developers. This commit specifically
modifies the types of relevant fields to use `IndexSet<String>` to later
down the line provide ease-of-use modifiers to e.g. add a writer.

Note that the docs in `lib.rs` are outdated as fields are no longer
public. This will be fixed in the next commit, when the convienience
accessors are added.
refactor+feat: Add convenience getters, setters, and other methods
All checks were successful
Build / build (push) Successful in 37s
a4c6fae9fe
This is the second and last commit part of the internals refactor. This
commit specificallly adds a large macro that gets called in ComicInfo
structs, which is responsible for setting up all the convenience
functions. The macro is documented.

With this commit, the docs in `lib.rs` are no longer outdated, as they
now use the getters/setters/convenience functions as provided by the
macro.
dan merged commit 3c2291ffcd into main 2025-11-27 16:21:33 +01:00
dan deleted branch refactor-indexset 2025-11-27 16:21:33 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dan/comicinfo!2
No description provided.