Repository navigation
Commit b7d3284
refactor(config): remove dead save_config function (#287)
## Summary
- Deletes the unused `save_config` function in `src/config/storage.rs`
and its dedicated `save_then_load_config` round-trip test.
- Updates `concurrent_update_config_does_not_corrupt` to seed the config
file with `update_config(|_| {})` instead of
`save_config(&Config::default())`.
- Closes Detail bug `bug_3b5a0cd5-08da-482d-b222-ce83e5acb944` (linked
GH #269), which reported a truncate-before-lock race in `save_config`.
Fixing the race isn't worth it since the function has no production
callers — `grep -rn save_config --include='*.rs'` showed only the
function definition and two `#[cfg(test)]` sites in the same file.
## Note for reviewers
`save_config` is `pub`, and although `Cargo.toml` only declares a
`[[bin]]`, the crate also has `src/lib.rs`, so Cargo auto-builds a
library and `detail_cli::config::storage::save_config` was technically
part of the library's public API. We don't publish to crates.io and
there are no other consumers of this crate's library surface that we
know of, but flagging in case you want to weigh that.
## Test plan
- [x] `cargo test` — all 289 lib + 17 integration tests pass
- [x] `grep -rn save_config --include='*.rs'` returns no matches after
the change
- [x] `concurrent_update_config_does_not_corrupt` still passes with the
new init line
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f5db2ea commit b7d3284
1 file changed
Lines changed: 2 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | 67 | | |
78 | 68 | | |
79 | 69 | | |
| |||
262 | 252 | | |
263 | 253 | | |
264 | 254 | | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
| 255 | + | |
283 | 256 | | |
284 | 257 | | |
285 | 258 | | |
| |||
492 | 465 | | |
493 | 466 | | |
494 | 467 | | |
495 | | - | |
| 468 | + | |
496 | 469 | | |
497 | 470 | | |
498 | 471 | | |
| |||
0 commit comments