From bcaaaf6dd98d8da69e4755b0bcb3e0f4dd3cfee6 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 25 Feb 2021 11:59:18 -0500 Subject: [PATCH] Spelling fixes in comments (#508) --- src/codec/framed_write.rs | 2 +- src/frame/data.rs | 4 ++-- src/hpack/encoder.rs | 2 +- src/lib.rs | 2 +- src/proto/streams/prioritize.rs | 2 +- src/proto/streams/recv.rs | 2 +- src/server.rs | 4 ++-- tests/h2-tests/tests/client_request.rs | 2 +- tests/h2-tests/tests/stream_states.rs | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/codec/framed_write.rs b/src/codec/framed_write.rs index b69979a..4191e03 100644 --- a/src/codec/framed_write.rs +++ b/src/codec/framed_write.rs @@ -55,7 +55,7 @@ enum Next { Continuation(frame::Continuation), } -/// Initialze the connection with this amount of write buffer. +/// Initialize the connection with this amount of write buffer. /// /// The minimum MAX_FRAME_SIZE is 16kb, so always be able to send a HEADERS /// frame that big. diff --git a/src/frame/data.rs b/src/frame/data.rs index 91de52d..e253d5e 100644 --- a/src/frame/data.rs +++ b/src/frame/data.rs @@ -36,7 +36,7 @@ impl Data { } } - /// Returns the stream identifer that this frame is associated with. + /// Returns the stream identifier that this frame is associated with. /// /// This cannot be a zero stream identifier. pub fn stream_id(&self) -> StreamId { @@ -63,7 +63,7 @@ impl Data { } } - /// Returns whther the `PADDED` flag is set on this frame. + /// Returns whether the `PADDED` flag is set on this frame. #[cfg(feature = "unstable")] pub fn is_padded(&self) -> bool { self.flags.is_padded() diff --git a/src/hpack/encoder.rs b/src/hpack/encoder.rs index ee264d5..cafd405 100644 --- a/src/hpack/encoder.rs +++ b/src/hpack/encoder.rs @@ -324,7 +324,7 @@ fn encode_str(val: &[u8], dst: &mut DstBuf<'_>) -> Result<(), EncoderError> { // Write the string head dst.get_mut()[idx] = 0x80 | huff_len as u8; } else { - // Write the head to a placeholer + // Write the head to a placeholder const PLACEHOLDER_LEN: usize = 8; let mut buf = [0u8; PLACEHOLDER_LEN]; diff --git a/src/lib.rs b/src/lib.rs index 8a33688..b69aafa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -126,7 +126,7 @@ pub use codec::{Codec, RecvError, SendError, UserError}; use std::task::Poll; // TODO: Get rid of this trait once https://github.com/rust-lang/rust/pull/63512 -// is stablized. +// is stabilized. trait PollExt { /// Changes the success value of this `Poll` with the closure provided. fn map_ok_(self, f: F) -> Poll>> diff --git a/src/proto/streams/prioritize.rs b/src/proto/streams/prioritize.rs index 701b8f4..77eb507 100644 --- a/src/proto/streams/prioritize.rs +++ b/src/proto/streams/prioritize.rs @@ -18,7 +18,7 @@ use std::{cmp, fmt, mem}; /// This is because "idle" stream IDs – those which have been initiated but /// have yet to receive frames – will be implicitly closed on receipt of a /// frame on a higher stream ID. If these queues was not ordered by stream -/// IDs, some mechanism would be necessary to ensure that the lowest-numberedh] +/// IDs, some mechanism would be necessary to ensure that the lowest-numbered] /// idle stream is opened first. #[derive(Debug)] pub(super) struct Prioritize { diff --git a/src/proto/streams/recv.rs b/src/proto/streams/recv.rs index 7a6ff8a..252fd86 100644 --- a/src/proto/streams/recv.rs +++ b/src/proto/streams/recv.rs @@ -54,7 +54,7 @@ pub(super) struct Recv { /// Refused StreamId, this represents a frame that must be sent out. refused: Option, - /// If push promises are allowed to be recevied. + /// If push promises are allowed to be received. is_push_enabled: bool, } diff --git a/src/server.rs b/src/server.rs index 50591bc..6ad010b 100644 --- a/src/server.rs +++ b/src/server.rs @@ -1059,7 +1059,7 @@ impl SendResponse { /// /// # Panics /// - /// If the lock on the strean store has been poisoned. + /// If the lock on the stream store has been poisoned. pub fn stream_id(&self) -> crate::StreamId { crate::StreamId::from_internal(self.inner.stream_id()) } @@ -1131,7 +1131,7 @@ impl SendPushedResponse { /// /// # Panics /// - /// If the lock on the strean store has been poisoned. + /// If the lock on the stream store has been poisoned. pub fn stream_id(&self) -> crate::StreamId { self.inner.stream_id() } diff --git a/tests/h2-tests/tests/client_request.rs b/tests/h2-tests/tests/client_request.rs index 23b5dbb..7dc2680 100644 --- a/tests/h2-tests/tests/client_request.rs +++ b/tests/h2-tests/tests/client_request.rs @@ -708,7 +708,7 @@ async fn recv_too_big_headers() { .await; srv.send_frame(frames::headers(1).response(200).eos()).await; srv.send_frame(frames::headers(3).response(200)).await; - // no reset for 1, since it's closed anyways + // no reset for 1, since it's closed anyway // but reset for 3, since server hasn't closed stream srv.recv_frame(frames::reset(3).refused()).await; idle_ms(10).await; diff --git a/tests/h2-tests/tests/stream_states.rs b/tests/h2-tests/tests/stream_states.rs index 16d1a75..cd2644d 100644 --- a/tests/h2-tests/tests/stream_states.rs +++ b/tests/h2-tests/tests/stream_states.rs @@ -460,7 +460,7 @@ async fn send_rst_stream_allows_recv_data() { srv.send_frame(frames::headers(1).response(200)).await; srv.recv_frame(frames::reset(1).cancel()).await; // sending frames after canceled! - // note: sending 2 to cosume 50% of connection window + // note: sending 2 to consume 50% of connection window srv.send_frame(frames::data(1, vec![0; 16_384])).await; srv.send_frame(frames::data(1, vec![0; 16_384]).eos()).await; // make sure we automatically free the connection window @@ -736,7 +736,7 @@ async fn rst_while_closing() { h2_support::trace_init!(); let (io, mut srv) = mock::new(); - // Rendevous when we've queued a trailers frame + // Rendezvous when we've queued a trailers frame let (tx, rx) = oneshot::channel(); let srv = async move {