Skip to content

Commit 6e576ff

Browse files
committed
Remove redundant check from test state cleaner
1 parent 2894ff3 commit 6e576ff

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

crates/daphne-worker/src/aggregator/router/extractor.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) 2025 Cloudflare, Inc. All rights reserved.
22
// SPDX-License-Identifier: BSD-3-Clause
33

4-
use std::io::Cursor;
5-
64
use axum::{
75
async_trait,
86
body::Bytes,
@@ -41,11 +39,10 @@ macro_rules! impl_decode_from_dap_http_body {
4139
bytes: Bytes,
4240
meta: &DapRequestMeta,
4341
) -> Result<Self, DapAbort> {
44-
let mut cursor = Cursor::new(bytes.as_ref());
4542
// Check that media type matches.
4643
meta.get_checked_media_type(DapMediaType::$type)?;
4744
// Decode the body
48-
$type::decode_with_param(&meta.version, &mut cursor)
45+
$type::get_decoded_with_param(&meta.version, bytes.as_ref())
4946
.map_err(|e| DapAbort::from_codec_error(e, meta.task_id))
5047
}
5148
}
@@ -62,11 +59,10 @@ impl_decode_from_dap_http_body!(
6259

6360
impl DecodeFromDapHttpBody for HashedAggregationJobReq {
6461
fn decode_from_http_body(bytes: Bytes, meta: &DapRequestMeta) -> Result<Self, DapAbort> {
65-
let mut cursor = Cursor::new(bytes.as_ref());
6662
// Check that media type matches.
6763
meta.get_checked_media_type(DapMediaType::AggregationJobInitReq)?;
6864
// Decode the body
69-
HashedAggregationJobReq::decode_with_param(&meta.version, &mut cursor)
65+
HashedAggregationJobReq::get_decoded_with_param(&meta.version, bytes.as_ref())
7066
.map_err(|e| DapAbort::from_codec_error(e, meta.task_id))
7167
}
7268
}

crates/daphne-worker/src/durable/test_state_cleaner.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ impl TestStateCleaner {
4343
Some(bindings::TestStateCleaner::Put) => {
4444
let durable_ref: DurableReference =
4545
serde_json::from_slice(&req.bytes().await?).unwrap();
46-
match durable_ref.binding.as_ref() {
47-
bindings::AggregateStore::BINDING => (),
48-
s => {
49-
let message = format!("GarbageCollector: unrecognized binding: {s}");
50-
console_error!("{}", message);
51-
return Err(int_err(message));
52-
}
53-
};
5446

5547
let queued = DurableOrdered::new_roughly_ordered(durable_ref, "object");
5648
queued.put(&self.state).await?;

0 commit comments

Comments
 (0)