Skip to content

Remove redundant cfg split around Network::new - #421

Merged
LargeModGames merged 1 commit into
mainfrom
fix/redundant-network-new-cfg
Aug 5, 2026
Merged

Remove redundant cfg split around Network::new#421
LargeModGames merged 1 commit into
mainfrom
fix/redundant-network-new-cfg

Conversation

@LargeModGames

@LargeModGames LargeModGames commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

runtime.rs:1287 and 1289 were byte-for-byte identical, so the #[cfg(feature = "streaming")] / #[cfg(not(...))] split around them did nothing (flagged in #419). The streaming and non-streaming Network::new constructors share one signature, so a single call compiles under both feature sets, as the unguarded call at runtime.rs:1945 already shows. The split was a leftover from when the constructors took different arguments; a later refactor unified the signatures but left the dead branches. Collapses both occurrences to a single call and fixes the misplaced // CLI doesn't use streaming comment, which had been sitting on the streaming branch.

Testing

  • cargo fmt --all
  • cargo clippy --no-default-features --features telemetry -- -D warnings
  • cargo check --no-default-features --features telemetry
  • cargo check --features all-sources

Additional notes

Closes #419. Reported by @istipisti113.

Summary by CodeRabbit

  • Refactor
    • Simplified network initialization across CLI and background event handling.
    • No user-visible behavior changes.

The streaming and non-streaming Network::new constructors share an
identical signature, so gating the call sites on the streaming feature
selected between two byte-for-byte identical lines and did nothing. The
split was a leftover from when the two constructors took different
arguments; a later refactor unified the signatures but left the dead
cfg branches behind.

Collapse both call sites to a single call and fix the misplaced
"CLI doesn't use streaming" comment, which had been sitting on the
streaming branch. Reported in #419.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ecce6be8-d9ed-4a51-a35d-96cce1d3325d

📥 Commits

Reviewing files that changed from the base of the PR and between 962cb81 and adae3e1.

📒 Files selected for processing (1)
  • src/runtime.rs

📝 Walkthrough

Walkthrough

The runtime removes redundant feature-gated branches from CLI and background network initialization. Both paths now use the same Network::new constructor call.

Changes

Network initialization

Layer / File(s) Summary
Unify constructor paths
src/runtime.rs
CLI and background network initialization no longer use separate streaming and non-streaming constructor branches.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes the main change but does not use a required conventional-commit prefix such as refactor:. Add a conventional-commit prefix and keep the subject concise and imperative, for example refactor: remove redundant cfg split around Network::new.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/redundant-network-new-cfg
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/redundant-network-new-cfg

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LargeModGames
LargeModGames merged commit ed3a9a5 into main Aug 5, 2026
16 checks passed
@LargeModGames
LargeModGames deleted the fix/redundant-network-new-cfg branch August 5, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Same lines despite comment

1 participant