Skip to content

chore: code cleanup - narrow visibility, extract constant, fix httpmock 0.8 API, fix workspace-hack - #103

Merged
loonghao merged 1 commit into
mainfrom
chore/code-cleanup-2026-03-26
Mar 26, 2026
Merged

chore: code cleanup - narrow visibility, extract constant, fix httpmock 0.8 API, fix workspace-hack#103
loonghao merged 1 commit into
mainfrom
chore/code-cleanup-2026-03-26

Conversation

@loonghao

Copy link
Copy Markdown
Collaborator

Code Cleanup (Cycle #4)

Automated code cleanup pass for the fpt-cli project.

Changes

1. Extract TOKEN_CACHE_POISONED constant (transport.rs)

  • Extracted duplicate "token cache is poisoned" string literal into a named constant
  • Used in both read_token_cache and write_token_cache operations

2. Narrow plan_entity_* visibility (transport.rs)

  • Changed plan_entity_create, plan_entity_update, plan_entity_delete, plan_entity_revive from pub to pub(crate)
  • These functions are only used within the fpt-domain crate and are not re-exported in lib.rs

3. Fix httpmock 0.8 API migration (rest_transport_tests.rs)

  • body_contains()body_includes() (3 occurrences)
  • .hits().calls() (110 occurrences)
  • Pre-existing test compilation failure now resolved

4. Fix workspace-hack duplicate dependency (workspace-hack/Cargo.toml)

  • Merged two windows-sys v0.61 entries with different feature sets into a single unified entry
  • Resolved pre-existing cargo check / cargo clippy build failure

Verification

  • cargo fmt --all — formatted
  • cargo clippy --workspace — zero warnings
  • cargo test --workspace — all tests pass (97 passed, 2 doc-tests ignored)

…ck 0.8 API, fix workspace-hack

- Extract TOKEN_CACHE_POISONED constant from duplicate string literals in transport.rs

- Narrow plan_entity_{create,update,delete,revive} from pub to pub(crate)

- Migrate httpmock 0.8 API: body_contains -> body_includes, hits() -> calls()

- Fix workspace-hack duplicate windows-sys entries
@loonghao
loonghao merged commit f263ba6 into main Mar 26, 2026
4 of 5 checks passed
@loonghao
loonghao deleted the chore/code-cleanup-2026-03-26 branch March 26, 2026 02:50
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