You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(meta): replace manual struct instantiation with constructor methods (#18393)
* refactor(meta): replace manual LogEntry construction with constructor methods
Replace manual LogEntry struct instantiation with LogEntry::new(cmd) for cases
where time_ms is None, and introduce LogEntry::new_with_time(cmd, time_ms) for
cases that need to preserve existing timestamps.
* refactor(meta): replace manual struct instantiation with constructor methods
Replace manual struct instantiation with constructor methods across meta types
to improve code consistency and maintainability following the LogEntry pattern:
- UpsertKV: Use ::new(), ::update(), ::delete() instead of manual instantiation
- WatchRequest: Use ::new() with ::with_filter(), ::with_initial_flush() builders
- RaftRequest: Use GrpcHelper::encode_raft_request() for consistent serialization
- TxnPutRequest: Add ::new() constructor for (key, value, prev_value, expire_at, ttl_ms)
- TxnGetRequest: Add ::new() constructor for (key)
- TxnDeleteRequest: Add ::new() constructor for (key, prev_value, match_seq)
This provides better type safety, readability, and ensures field changes only
require updating constructor methods rather than scattered manual instantiations.
* chore: fmt
* chore(meta): resolve clippy warnings for unused imports and private module access
- Remove unused MatchSeq and Operation imports from util.rs
- Fix grpc_helper module access by using re-exported GrpcHelper
- Ensure all constructor method refactoring passes clippy lints
* chore: fix fmt
0 commit comments