mirror of
https://github.com/nyakang/nyaterm.git
synced 2026-10-05 00:01:00 +00:00
`storage.rs` was 7662 lines with one `impl ConnectionStore` spanning three thousand of them. Earlier rounds extracted a few pure type modules, which barely moved the count because the types were the small part. These two go out as whole domains instead, each taking everything that belongs to it: table constants and key prefixes, record types, the `*_in_txn` helpers, and — for command history — the prompt-stripping logic that only `sanitize_history_command` used. `known_hosts` also took `storage.rs`'s only uses of `base64`, `hmac` and `sha1`. Three crate dependencies leaving with one domain is the sign the seam was in the right place; a type-by-type extraction would never have surfaced that. Table names, key layouts, record shapes, the legacy text-doc import and the hashed-host matching rules are unchanged — this moves code, it does not touch the persistence contract. 166 core tests still pass, including the known-hosts structured/hashed/raw round-trip, the match/changed/ unknown distinction, the legacy import, and command-history normalization. storage.rs: 7662 -> 7077 lines.