Skip to content

Commit

Permalink
Spelling fixes in comments (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref authored Feb 25, 2021
1 parent c1b411f commit bcaaaf6
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/codec/framed_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ enum Next<B> {
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.
Expand Down
4 changes: 2 additions & 2 deletions src/frame/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl<T> Data<T> {
}
}

/// 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 {
Expand All @@ -63,7 +63,7 @@ impl<T> Data<T> {
}
}

/// 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()
Expand Down
2 changes: 1 addition & 1 deletion src/hpack/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T, E> {
/// Changes the success value of this `Poll` with the closure provided.
fn map_ok_<U, F>(self, f: F) -> Poll<Option<Result<U, E>>>
Expand Down
2 changes: 1 addition & 1 deletion src/proto/streams/prioritize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/proto/streams/recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub(super) struct Recv {
/// Refused StreamId, this represents a frame that must be sent out.
refused: Option<StreamId>,

/// If push promises are allowed to be recevied.
/// If push promises are allowed to be received.
is_push_enabled: bool,
}

Expand Down
4 changes: 2 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ impl<B: Buf> SendResponse<B> {
///
/// # 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())
}
Expand Down Expand Up @@ -1131,7 +1131,7 @@ impl<B: Buf> SendPushedResponse<B> {
///
/// # 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()
}
Expand Down
2 changes: 1 addition & 1 deletion tests/h2-tests/tests/client_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/h2-tests/tests/stream_states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit bcaaaf6

Please sign in to comment.