Skip to content

Commit 01bcd4d

Browse files
aljoschaclaude
andcommitted
adapter: split internal-subscribe match arm to drop as-cast
The original `if active_subscribe.internal { ... as BuiltinTableAppendNotify }` branch needed an explicit cast (with a `clippy::as_conversions` allow) for the if/else types to unify. Splitting into a guarded match arm lets the match's coercion site unsize both `Box::pin`s to the trait-object type. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d5dc315 commit 01bcd4d

1 file changed

Lines changed: 15 additions & 20 deletions

File tree

src/adapter/src/coord/sql.rs

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -259,29 +259,24 @@ impl Coordinator {
259259
.drop_sinks
260260
.insert(id);
261261

262-
let ret_fut = match &active_sink {
262+
let ret_fut: BuiltinTableAppendNotify = match &active_sink {
263+
// Internal subscribes skip the builtin table update.
264+
ActiveComputeSink::Subscribe(active_subscribe) if active_subscribe.internal => {
265+
Box::pin(std::future::ready(()))
266+
}
263267
ActiveComputeSink::Subscribe(active_subscribe) => {
264-
// Skip builtin table update for internal subscribes
265-
if active_subscribe.internal {
266-
#[allow(clippy::as_conversions)]
267-
{
268-
Box::pin(std::future::ready(())) as BuiltinTableAppendNotify
269-
}
270-
} else {
271-
let update = self.catalog().state().pack_subscribe_update(
272-
id,
273-
active_subscribe,
274-
Diff::ONE,
275-
);
276-
let update = self.catalog().state().resolve_builtin_table_update(update);
268+
let update =
269+
self.catalog()
270+
.state()
271+
.pack_subscribe_update(id, active_subscribe, Diff::ONE);
272+
let update = self.catalog().state().resolve_builtin_table_update(update);
277273

278-
self.metrics
279-
.active_subscribes
280-
.with_label_values(&[session_type])
281-
.inc();
274+
self.metrics
275+
.active_subscribes
276+
.with_label_values(&[session_type])
277+
.inc();
282278

283-
self.builtin_table_update().execute(vec![update]).await.0
284-
}
279+
self.builtin_table_update().execute(vec![update]).await.0
285280
}
286281
ActiveComputeSink::CopyTo(_) => {
287282
self.metrics

0 commit comments

Comments
 (0)