Skip to content

Simplify serde defaults and deduplicate display#12

Merged
jserv merged 1 commit intomainfrom
refine
Feb 11, 2026
Merged

Simplify serde defaults and deduplicate display#12
jserv merged 1 commit intomainfrom
refine

Conversation

@jserv
Copy link
Copy Markdown
Owner

@jserv jserv commented Feb 11, 2026

This replaces field-level #[serde(default = "fn")] with struct-level #[serde(default)] across CacheConfig, ResilienceConfig, Config, and PreserveConfig, using Default impl as single source of truth.

It deduplicates handle_show_preserved() from 6 repetitive if-blocks into a data-driven loop while preserving per-category header colors and per-segment display formatting (truncation/newline-escape for CodeBlock only, .yellow() + "(markers stripped)" for NoTranslate, .blue() for EnglishTerm, .dimmed() for the rest).

This replaces field-level #[serde(default = "fn")] with struct-level
'#[serde(default)]' across CacheConfig, ResilienceConfig, Config, and
PreserveConfig, using Default impl as single source of truth.

It deduplicates handle_show_preserved() from 6 repetitive if-blocks into
a data-driven loop while preserving per-category header colors and
per-segment display formatting (truncation/newline-escape for CodeBlock
only, .yellow() + "(markers stripped)" for NoTranslate, .blue() for
EnglishTerm, .dimmed() for the rest).
@jserv jserv merged commit ccfbe23 into main Feb 11, 2026
5 checks passed
@jserv jserv deleted the refine branch February 11, 2026 05:13
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.24%. Comparing base (f8132c6) to head (c3b9670).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #12      +/-   ##
==========================================
+ Coverage   65.16%   68.24%   +3.08%     
==========================================
  Files          11       11              
  Lines         775      762      -13     
==========================================
+ Hits          505      520      +15     
+ Misses        270      242      -28     
Flag Coverage Δ
unittests 68.24% <100.00%> (+3.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/cache.rs 60.20% <ø> (+5.10%) ⬆️
src/config.rs 20.00% <100.00%> (-12.61%) ⬇️
src/detector.rs 100.00% <ø> (+21.87%) ⬆️
src/error.rs 72.72% <ø> (+20.09%) ⬆️
src/preserver.rs 98.78% <100.00%> (+1.21%) ⬆️
src/resilience.rs 82.24% <ø> (+1.86%) ⬆️
src/security.rs 97.87% <100.00%> (ø)
src/stats.rs 88.67% <ø> (ø)
src/translator.rs 44.71% <ø> (-0.97%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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