feat(core): 开放已验证输入的只读访问 - #305
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更
ZiweiBirth开放gender、year、month、day、hour只读 getterZiweiInput开放gender、birth_stem、birth_branch、month、day、hour只读 getter原因
已验证输入是公共值对象,调用方需要读取其中已经规范化的事实;只读 getter 在不削弱类型不变量的前提下提供这一能力。
影响
这是只读公共接口扩展,不增加 setter、builder 或新的构造路径,也不改变命盘计算结果。
验证
cargo fmt --all --checkcargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --workspace --all-targets --locked(55 passed,1 ignored)cargo test --workspace --doc --lockedcargo test -p ziwei --test natal_exhaustive --release --locked -- --ignoredRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --lockedgit diff --check