Delete dead newtypes and regexes in meta/types/common/v1.rs - #321
Conversation
RainSymbol, RainTitle, RainString (and its alias Description), SolidityIdentifier, REGEX_SOLIDITY_IDENTIFIER, REGEX_RAIN_TITLE and HASH_PATTERN lost their last consumers when #318 deleted the SolidityAbiMeta and InterpreterCallerMeta models. REGEX_RAIN_SYMBOL and REGEX_RAIN_STRING stay for authoring v1 and v2; their tests now match the regexes directly with the same inputs. Closes #319. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EyWWorieTJV9FmMm2JM6Ua
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment: S/M/L PR Classification Guidelines:This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed. Small (S)Characteristics:
Review Effort: Would have taken 5-10 minutes Examples:
Medium (M)Characteristics:
Review Effort: Would have taken 15-30 minutes Examples:
Large (L)Characteristics:
Review Effort: Would have taken 45+ minutes Examples:
Additional Factors to ConsiderWhen deciding between sizes, also consider:
Notes:
|
Closes #319.
crates/cli/src/meta/types/common/v1.rslost its consumers when #318 deleted theSolidityAbiMetaandInterpreterCallerMetamodels. This deletes what nothing uses and keeps whatauthoring/v1.rsandauthoring/v2.rsstill import.Deleted, each confirmed by
grep -rnwto have hits only insidecommon/v1.rs(definition and its own test):RainSymbol,RainTitle,RainString,SolidityIdentifierand their testspub type Description = RainString;(not named in the issue; it cannot outliveRainString, and has zero consumers)REGEX_SOLIDITY_IDENTIFIER,REGEX_RAIN_TITLE,HASH_PATTERNandtest_hash_patternvalidator,serdeandschemarsimports of this file, unused once the derive-carrying structs are goneKept:
REGEX_RAIN_SYMBOL(used byauthoring/v1.rs:8,32andauthoring/v2.rs:17,25)REGEX_RAIN_STRING(used byauthoring/v1.rs:8,41andauthoring/v2.rs:17,30)test_rain_symbol_validateandtest_rain_string_validate, retargeted fromRainSymbol { value }.validate()/RainString { value }.validate()toREGEX_RAIN_SYMBOL.is_match/REGEX_RAIN_STRING.is_matchwith the valid and invalid input lists unchangedCargo.toml is untouched:
validator(cli/mod.rs, cli/validate.rs, error/mod.rs, metaboard.rs, authoring v1 and v2),schemars(cli/schema.rs, lib.rs, authoring v1),once_cell(cli/schema_check.rs) andregex(this file) each keep other users.QA
All commands run in the branch worktree at
dd655b3insidenix develop -c.cargo fmt --all: exit 0,git diff --statunchanged afterwards (1 file, 6 insertions, 218 deletions).cargo test --workspace 2>&1 | grep -E "^error|^test result|FAILED|panicked": 11test result: oklines, 347 passed, 0 failed, 0^errorlines.common/v1.rscarries 2#[test](base: 5; the 3 gone aretest_rain_title_validate,test_solidity_identifier_validate,test_hash_pattern).cargo test --workspace --all-features: same 11 lines, 347 passed, 0 failed.cargo clippy --workspace --all-targets -- -D warnings: exit 0, no warnings.cargo clippy --workspace --all-targets --all-features -- -D warnings -D clippy::all(whatrainix-rs-staticruns): exit 0, no warnings.cargo build -p rain-metadata --features cli: exit 0.grep -rnw <name> .(rs, toml, md, json, ts, js, nix, yml) forRainSymbol,RainTitle,RainString,Description,SolidityIdentifier,REGEX_SOLIDITY_IDENTIFIER,REGEX_RAIN_TITLE,HASH_PATTERNhits onlycrates/cli/src/meta/types/common/v1.rson base.REGEX_RAIN_SYMBOLandREGEX_RAIN_STRINGhitauthoring/v1.rsandauthoring/v2.rs, so they stay.grep -rnE "pub use .*common|mod common"finds onlypub mod common;inmeta/types/mod.rs, no re-export.meta/types/common/mod.rs,#[cfg(test)] use self::v1::{RainSymbol, RainTitle, RainString, Description, SolidityIdentifier, REGEX_SOLIDITY_IDENTIFIER, REGEX_RAIN_TITLE, HASH_PATTERN};, thencargo check -p rain-metadata --tests. On base (d40cff9, detached worktree, shared target dir) it compiles,Finished, exit 0, because every name is still defined there; on this branch it fails witherror[E0432]: unresolved importsnaming all eight, exit 101. The retainedtest_rain_symbol_validateandtest_rain_string_validatepass on both base and branch by design, since the regexes and inputs are unchanged. Probe removed from both; base worktree removed.common/v1.rs, restored from a byte-for-byte backup afterwards withdiffconfirming the restore, thencargo test -p rain-metadata common::v1re-run green (2 passed).REGEX_RAIN_SYMBOLfirst class[a-z]widened to[a-zA-Z]->test_rain_symbol_validateFAILED (panic at v1.rs:34, the invalids loop);test_rain_string_validateok.REGEX_RAIN_STRINGclass replaced by[\s!-~]->test_rain_string_validateFAILED (panic at v1.rs:61, the invalids loop, Unicode whitespace accepted);test_rain_symbol_validateok.origin/main:crates/cli/src/meta/types/common/v1.rs. The two retained regex literals and the valid and invalid input lists of the two retained tests are copied from it unchanged; only the assertion subject changed from<Newtype> { value }.validate().is_ok()/is_err()toREGEX_*.is_match(i)/!REGEX_*.is_match(i). Consumer absence inside the repo is the grep above; the org-wide and crates.io consumer absence is as stated in Delete dead newtypes and regexes in meta/types/common/v1.rs #319 and not re-derived here.REGEX_RAIN_SYMBOLandREGEX_RAIN_STRINGwith their tests, and drop unused imports without touching Cargo.toml. Covered all of it. The PR additionally removespub type Description = RainString;, which the issue names in its first line and which cannot compile withoutRainString. No other file changes.🤖 Generated with Claude Code
https://claude.ai/code/session_01EyWWorieTJV9FmMm2JM6Ua