Skip to content

refactor(config): derive Default for PackageConfig and drop the repeated literals - #1311

Merged
BryanFRD merged 1 commit into
mainfrom
refactor/package-config-constructor
Oct 10, 2026
Merged

BryanFRD merged 1 commit into
mainfrom
refactor/package-config-constructor

Conversation

@BryanFRD

Copy link
Copy Markdown
Contributor

Closes #1310

PackageConfig now derives Default. The 22 literals that listed every optional field as None or empty name only what they set and end with ..Default::default(). No behaviour change, net -272 lines.

@BryanFRD
BryanFRD enabled auto-merge (squash) October 10, 2026 15:10

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This doesn't change behaviour. Every non-String field is an Option or a Vec, so the derived Default gives the same None / empty values the removed literals spelled out. The code search on main finds the old literal only in these 13 files, so none were missed. Replacing package_config() in init.rs with struct update syntax is the idiomatic way to do it. Nothing blocking.

@BryanFRD
BryanFRD merged commit 7ea1f53 into main Oct 10, 2026
32 checks passed
@BryanFRD
BryanFRD deleted the refactor/package-config-constructor branch October 10, 2026 15:13
ferrflow Bot added a commit that referenced this pull request Oct 10, 2026
## [7.30.1] - 2026-10-10

### Refactoring

- refactor: share the discovery collection and print bump types through Display (#1313)
- refactor(config): derive Default for PackageConfig and drop the repeated literals (#1311)
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.

PackageConfig literals repeat every optional field

1 participant