From c23bf31789fc8f0829e821f3790d0c5f4e24f61e Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Thu, 5 Oct 2023 13:19:29 +0700 Subject: [PATCH] docs: Fix typos. --- README.md | 2 +- wtransport-proto/src/bytes.rs | 8 ++++---- wtransport-proto/src/frame.rs | 2 +- wtransport-proto/src/ids.rs | 2 +- wtransport-proto/src/settings.rs | 2 +- wtransport-proto/src/stream_header.rs | 2 +- wtransport/src/driver/utils.rs | 4 ++-- wtransport/src/endpoint.rs | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 49c2efe..f5fe35e 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ Replace `FINGERPRINT` with the value obtained in *step 1*. For example, `OjyqTe//WoGnvBrgiO37tkOQJyuN1r7hhyBzwX0gotg=`. ### 4. Connect to the Server -Open the website https://webtransport.day/ on Google Chrome instace. Use the *URL*: `https://localhost:4433`, and click on *Connect*. +Open the website https://webtransport.day/ on Google Chrome instance. Use the *URL*: `https://localhost:4433`, and click on *Connect*. Enjoy! diff --git a/wtransport-proto/src/bytes.rs b/wtransport-proto/src/bytes.rs index 22c6169..9fde7d7 100644 --- a/wtransport-proto/src/bytes.rs +++ b/wtransport-proto/src/bytes.rs @@ -64,7 +64,7 @@ impl BytesWriter for Vec { BufferWriter::new(&mut self[offset..]) .put_varint(varint) - .expect("Enough capacity prellocated"); + .expect("Enough capacity pre-allocated"); Ok(()) } @@ -328,7 +328,7 @@ pub mod r#async { /// Generally, an implementation will perform a **copy**. /// /// On success, it returns `Ok(num_bytes_read)`, that is the - /// lenght of bytes written into `buf`. + /// length of bytes written into `buf`. /// /// It returns `0` if and only if: /// * `buf` is empty; or @@ -378,7 +378,7 @@ pub mod r#async { /// * [`std::io::ErrorKind::ConnectionReset`] if the write operation was explicitly stopped /// by the destination. /// * [`std::io::ErrorKind::NotConnected`] if the write operation aborted at any point because - /// lack of communication with the destionation. + /// lack of communication with the destination. fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, @@ -403,7 +403,7 @@ pub mod r#async { /// Reads an unsigned variable-length integer in network byte-order from a source. fn get_varint(&mut self) -> GetVarint; - /// Reads the source until `buffer` is completly filled. + /// Reads the source until `buffer` is completely filled. fn get_buffer<'a>(&'a mut self, buffer: &'a mut [u8]) -> GetBuffer; } diff --git a/wtransport-proto/src/frame.rs b/wtransport-proto/src/frame.rs index e5a7c65..8ea7d14 100644 --- a/wtransport-proto/src/frame.rs +++ b/wtransport-proto/src/frame.rs @@ -262,7 +262,7 @@ impl<'a> Frame<'a> { /// /// It returns [`Err`] if the `bytes_writer` does not have enough capacity /// to write the entire frame. - /// See [`Self::write_size`] to retrieve the extact amount of required capacity. + /// See [`Self::write_size`] to retrieve the exact amount of required capacity. /// /// In case [`Err`], `bytes_writer` might be partially written. /// diff --git a/wtransport-proto/src/ids.rs b/wtransport-proto/src/ids.rs index 6bba6c8..21ecced 100644 --- a/wtransport-proto/src/ids.rs +++ b/wtransport-proto/src/ids.rs @@ -190,7 +190,7 @@ impl QStreamId { pub const fn into_session_id(self) -> SessionId { let stream_id = self.into_stream_id(); - // SAFETY: corresponding stream for qstream is bidirection and client-initiated + // SAFETY: corresponding stream for qstream is bidirectional and client-initiated unsafe { debug_assert!(stream_id.is_bidirectional() && stream_id.is_client_initiated()); SessionId::from_session_stream_unchecked(stream_id) diff --git a/wtransport-proto/src/settings.rs b/wtransport-proto/src/settings.rs index c247fa7..0c1c337 100644 --- a/wtransport-proto/src/settings.rs +++ b/wtransport-proto/src/settings.rs @@ -162,7 +162,7 @@ impl Settings { /// /// This function does *not* allocates memory. It uses `buffer` for frame-payload /// serialization. - /// See [`Self::generate_frame`] for a versione with inner memory allocation. + /// See [`Self::generate_frame`] for a version with inner memory allocation. pub fn generate_frame_ref<'a>(&self, buffer: &'a mut [u8]) -> Result, EndOfBuffer> { let mut bytes_writer = BufferWriter::new(buffer); diff --git a/wtransport-proto/src/stream_header.rs b/wtransport-proto/src/stream_header.rs index a8c15ac..b816f75 100644 --- a/wtransport-proto/src/stream_header.rs +++ b/wtransport-proto/src/stream_header.rs @@ -203,7 +203,7 @@ impl StreamHeader { /// /// It returns [`Err`] if the `bytes_writer` does not have enough capacity /// to write the entire header. - /// See [`Self::write_size`] to retrieve the extact amount of required capacity. + /// See [`Self::write_size`] to retrieve the exact amount of required capacity. /// /// In case [`Err`], `bytes_writer` might be partially written. pub fn write(&self, bytes_writer: &mut W) -> Result<(), EndOfBuffer> diff --git a/wtransport/src/driver/utils.rs b/wtransport/src/driver/utils.rs index 6194990..4268a99 100644 --- a/wtransport/src/driver/utils.rs +++ b/wtransport/src/driver/utils.rs @@ -56,8 +56,8 @@ where /// Sets the shared result in thread safe manner. /// - /// The first call will be able to actuall set the inner value, - /// successive calles end up into being no-op. + /// The first call will be able to actually set the inner value, + /// successive calls end up into being no-op. /// /// Returns `true` if the inner result is actually set. pub fn set(&self, result: T) -> bool { diff --git a/wtransport/src/endpoint.rs b/wtransport/src/endpoint.rs index fa6cc14..bf6ad84 100644 --- a/wtransport/src/endpoint.rs +++ b/wtransport/src/endpoint.rs @@ -34,7 +34,7 @@ use wtransport_proto::headers::Headers; use wtransport_proto::session::SessionRequest as SessionRequestProto; use wtransport_proto::session::SessionResponse as SessionResponseProto; -/// Helper structure for Endpoind types. +/// Helper structure for Endpoint types. pub mod endpoint_side { /// Type of endpoint accepting multiple WebTransport connections. pub struct Server;