cleanup: remove dead code and unnecessary allow(dead_code) annotations#46
Closed
cleanup: remove dead code and unnecessary allow(dead_code) annotations#46
Conversation
Greptile OverviewGreptile SummaryThis PR removes dead code and unnecessary Changes:
All removed code was verified to be truly unused through codebase searches. The changes are purely cleanup with no impact on functionality. Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/cortex-app-server/src/storage.rs | Removed unused base_dir field from SessionStorage struct - field was only used during initialization and never read afterward |
| src/cortex-mcp-client/src/transport.rs | Removed unused reconnect() methods from both transport implementations, unused test_connection() method, and unused imports (tokio::time::sleep, tracing::error) |
| src/cortex-apply-patch/src/hunk.rs | Removed unused replace_all field and with_replace_all() method from internal SearchReplace struct - functionality was never implemented |
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant Compiler as Rust Compiler
participant Code as Codebase
Dev->>Code: Remove #[allow(dead_code)] annotations
Dev->>Code: Delete unused struct fields
Dev->>Code: Delete unused methods
Dev->>Code: Remove unused imports
Dev->>Compiler: cargo check
Compiler->>Code: Analyze all packages
Compiler-->>Dev: ✓ No dead_code warnings
Dev->>Compiler: cargo test
Compiler->>Code: Run tests for modified packages
Compiler-->>Dev: ✓ All tests pass
Contributor
Author
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.
Summary
This PR cleans up
#[allow(dead_code)]annotations in several modules. Dead code is either removed if truly unused, or the annotation is removed if the code is actually used.Changes
base_dirfield fromSessionStoragestruct (the field was stored but never read after initialization)reconnect()methods from bothStdioTransportandHttpTransport, along with the unusedtest_connection()method fromHttpTransport. Also removed unused imports (tokio::time::sleepandtracing::error)replace_allfield andwith_replace_all()method fromSearchReplacestruct (internal struct not exposed in public API)Verification
cargo check -p cortex-app-server -p cortex-mcp-client -p cortex-apply-patch cargo test -p cortex-app-server -p cortex-mcp-client -p cortex-apply-patch