Skip to content

Commit

Permalink
Clean up warnings (#237)
Browse files Browse the repository at this point in the history
* Address warning for unused field

* Apply suggestions from clippy

* Set resolver = 2 for the workspace
  • Loading branch information
djc authored May 3, 2024
1 parent b44edeb commit eb79204
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ members = [
# Internal
"examples",
]
resolver = "2"
6 changes: 3 additions & 3 deletions h3/src/qpack/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ mod tests {

assert_eq!(table.fields.len(), 1);
assert_eq!(
table.fields.get(0),
table.fields.front(),
Some(&HeaderField::new("Name-Large", "Value-Large"))
);
}
Expand Down Expand Up @@ -736,7 +736,7 @@ mod tests {
insert_fields(&mut table, vec![HeaderField::new("Name-C", "Value-C")]);

assert_eq!(
table.fields.get(0),
table.fields.front(),
Some(&HeaderField::new("Name-B", "Value-B"))
);
assert_eq!(
Expand Down Expand Up @@ -1042,7 +1042,7 @@ mod tests {
assert_eq!(table.track_map.get(&1), Some(&1));
}
let track_blocks = table.track_blocks;
let block = track_blocks.get(&stream_id).unwrap().get(0).unwrap();
let block = track_blocks.get(&stream_id).unwrap().front().unwrap();
assert_eq!(block.get(&1), Some(&1));
assert_eq!(block.get(&2), Some(&1));
assert_eq!(block.get(&3), Some(&1));
Expand Down
6 changes: 3 additions & 3 deletions h3/src/qpack/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn codec_basic_get() {
];

encoder
.encode(42, &mut block_buf, &mut enc_buf, header.clone().into_iter())
.encode(42, &mut block_buf, &mut enc_buf, header.clone())
.unwrap();

let mut enc_cur = Cursor::new(&mut enc_buf);
Expand Down Expand Up @@ -113,7 +113,7 @@ fn codec_table_size_0() {
let mut decoder = Decoder::from(dec_table);

encoder
.encode(42, &mut block_buf, &mut enc_buf, header.clone().into_iter())
.encode(42, &mut block_buf, &mut enc_buf, header.clone())
.unwrap();

let mut enc_cur = Cursor::new(&mut enc_buf);
Expand Down Expand Up @@ -148,7 +148,7 @@ fn codec_table_full() {
let mut decoder = Decoder::from(dec_table);

encoder
.encode(42, &mut block_buf, &mut enc_buf, header.clone().into_iter())
.encode(42, &mut block_buf, &mut enc_buf, header.clone())
.unwrap();

let mut enc_cur = Cursor::new(&mut enc_buf);
Expand Down
7 changes: 2 additions & 5 deletions h3/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ where
B: Buf,
{
Control(FrameStream<S, B>),
Push(u64, FrameStream<S, B>),
Push(FrameStream<S, B>),
Encoder(BufRecvStream<S, B>),
Decoder(BufRecvStream<S, B>),
WebTransportUni(SessionId, BufRecvStream<S, B>),
Expand Down Expand Up @@ -283,10 +283,7 @@ where
pub fn into_stream(self) -> Result<AcceptedRecvStream<S, B>, Error> {
Ok(match self.ty.expect("Stream type not resolved yet") {
StreamType::CONTROL => AcceptedRecvStream::Control(FrameStream::new(self.stream)),
StreamType::PUSH => AcceptedRecvStream::Push(
self.id.expect("Push ID not resolved yet").into_inner(),
FrameStream::new(self.stream),
),
StreamType::PUSH => AcceptedRecvStream::Push(FrameStream::new(self.stream)),
StreamType::ENCODER => AcceptedRecvStream::Encoder(self.stream),
StreamType::DECODER => AcceptedRecvStream::Decoder(self.stream),
StreamType::WEBTRANSPORT_UNI => AcceptedRecvStream::WebTransportUni(
Expand Down
3 changes: 1 addition & 2 deletions h3/src/tests/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ async fn server_send_data_without_finish() {
.await
.unwrap();
let data = vec![0; 100];
let _ = req
.send_data(bytes::Bytes::copy_from_slice(&data))
req.send_data(bytes::Bytes::copy_from_slice(&data))
.await
.unwrap();
let _ = req.recv_response().await.unwrap();
Expand Down

0 comments on commit eb79204

Please sign in to comment.