Repository navigation
chore(vector-core): remove fanout pass-by-value lint allow - #26321
Merged
thomasqueirozb merged 1 commit intoSep 9, 2026
Merged
thomasqueirozb merged 1 commit into
thomasqueirozb merged 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is a small, low-risk internal refactor that preserves behavior while removing a Clippy suppression.
Pull request overview
This PR refactors vector-core’s fanout control-message handling to remove a clippy::needless_pass_by_value suppression in SendGroup::add, changing the method to borrow the component key and clone only when inserting into the sender map.
Changes:
- Update
SendGroup::addto take&ComponentKeyand remove theclippy::needless_pass_by_valueallow. - Adjust the in-flight control-message
Addhandling to pass&idintoSendGroup::add.
File summaries
| File | Description |
|---|---|
| lib/vector-core/src/fanout.rs | Removes a Clippy suppression by switching SendGroup::add to take a borrowed key and cloning for insertion into the sender map. |
Review details
Suppressed comments (1)
lib/vector-core/src/fanout.rs:384
SendGroup::addnow takes&ComponentKeyand clones it to insert intoself.senders. SinceControlMessage::Addalready yields an ownedComponentKey, this introduces an avoidable allocation on every add (becauseComponentKeyclones its innerString). Consider switchingSendGroup::addback to takingid: ComponentKeyand moving it into theIndexMap(similar toFanout::add), which removes the need for both the clone and the previous clippy suppression.
// When we're in the middle of a send, we can only keep track of the new sink, but can't
// actually send to it, as we don't have the item to send... so only add it to `senders`.
assert!(
self.senders
.insert(id.clone(), Some(Sender::new(sink)))
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
thomasqueirozb
enabled auto-merge
September 9, 2026 20:00
Merged
via the queue into
vectordotdev:master
with commit Sep 9, 2026
5cfe2b2
82 of 83 checks passed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Removes the
clippy::needless_pass_by_valuesuppression fromSendGroup::addby borrowing the component key and cloning it only when inserting it into the sender map.References
Related: #23659
Vector configuration
Not applicable; this is an internal refactor with no configuration changes.
How did you test this PR?
cargo test -p vector-core fanout --libcargo clippy -p vector-core --lib -- -D warningscargo fmt --all -- --checkgit diff --checkDoes this PR include user facing changes?
no-changeloglabel to this PR.Contributor Guidelines
@vectordotdev/vectorto reach out to us regarding this PR.git merge origin masterandgit push.