From 929825048099919a507ee1041c17c5b24e2ad6f7 Mon Sep 17 00:00:00 2001 From: James Mayclin Date: Wed, 22 Jan 2025 09:56:05 -0800 Subject: [PATCH] chore: fix typos (#5052) --- bindings/rust/extended/s2n-tls/src/cert_chain.rs | 8 ++++---- bindings/rust/extended/s2n-tls/src/config.rs | 4 ++-- bindings/rust/extended/s2n-tls/src/connection.rs | 10 +++++----- bindings/rust/extended/s2n-tls/src/error.rs | 2 +- bindings/rust/extended/s2n-tls/src/fingerprint.rs | 2 +- bindings/rust/extended/s2n-tls/src/pool.rs | 2 +- bindings/rust/extended/s2n-tls/src/renegotiate.rs | 2 +- bindings/rust/extended/s2n-tls/src/testing/s2n_tls.rs | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bindings/rust/extended/s2n-tls/src/cert_chain.rs b/bindings/rust/extended/s2n-tls/src/cert_chain.rs index 4b461953c96..48a3f57dfd8 100644 --- a/bindings/rust/extended/s2n-tls/src/cert_chain.rs +++ b/bindings/rust/extended/s2n-tls/src/cert_chain.rs @@ -120,7 +120,7 @@ impl Builder { /// Return an immutable, internally-reference counted CertificateChain. pub fn build(self) -> Result, Error> { - // This method is currently infalliable, but returning a result allows + // This method is currently infallible, but returning a result allows // us to add validation in the future. Ok(self.cert) } @@ -128,7 +128,7 @@ impl Builder { /// A CertificateChain represents a chain of X.509 certificates. /// -/// Certificate chains are internally reference counted and are cheaply cloneable. +/// Certificate chains are internally reference counted and are cheaply clone-able. // // SAFETY: it is important that no CertificateChain methods operate on mutable // references. Because CertificateChains can be shared across threads, it is not @@ -179,7 +179,7 @@ impl CertificateChain<'_> { /// Return the length of this certificate chain. /// - /// Note that the underyling API currently traverses a linked list, so this is a relatively + /// Note that the underlying API currently traverses a linked list, so this is a relatively /// expensive API to call. /// /// Corresponds to [s2n_cert_chain_get_length]. @@ -196,7 +196,7 @@ impl CertificateChain<'_> { /// Check if the certificate chain has any certificates. /// - /// Note that the underyling API currently traverses a linked list, so this is a relatively + /// Note that the underlying API currently traverses a linked list, so this is a relatively /// expensive API to call. pub fn is_empty(&self) -> bool { self.len() == 0 diff --git a/bindings/rust/extended/s2n-tls/src/config.rs b/bindings/rust/extended/s2n-tls/src/config.rs index 246440690fd..c289b1bf0a8 100644 --- a/bindings/rust/extended/s2n-tls/src/config.rs +++ b/bindings/rust/extended/s2n-tls/src/config.rs @@ -301,7 +301,7 @@ impl Builder { /// can be loaded. /// /// For more advanced cert use cases such as sharing certs across configs or - /// serving differents certs based on the client SNI, see [Builder::load_chain]. + /// serving different certs based on the client SNI, see [Builder::load_chain]. /// /// Corresponds to [s2n_config_add_cert_chain_and_key]. pub fn load_pem(&mut self, certificate: &[u8], private_key: &[u8]) -> Result<&mut Self, Error> { @@ -320,7 +320,7 @@ impl Builder { /// Corresponds to [s2n_config_add_cert_chain_and_key_to_store]. pub fn load_chain(&mut self, chain: CertificateChain<'static>) -> Result<&mut Self, Error> { - // Out of an abudance of caution, we hold a reference to the CertificateChain + // Out of an abundance of caution, we hold a reference to the CertificateChain // regardless of whether add_to_store fails or succeeds. We have limited // visibility into the failure modes, so this behavior ensures that _if_ // the C library held the reference despite the failure, it would continue diff --git a/bindings/rust/extended/s2n-tls/src/connection.rs b/bindings/rust/extended/s2n-tls/src/connection.rs index b2508d2f232..f18608df1fb 100644 --- a/bindings/rust/extended/s2n-tls/src/connection.rs +++ b/bindings/rust/extended/s2n-tls/src/connection.rs @@ -466,7 +466,7 @@ impl Connection { Ok(self) } - /// Connections prefering low latency will be encrypted using small record sizes that + /// Connections preferring low latency will be encrypted using small record sizes that /// can be decrypted sooner by the recipient. /// /// Corresponds to [s2n_connection_prefer_low_latency]. @@ -475,7 +475,7 @@ impl Connection { Ok(self) } - /// Connections prefering throughput will use large record sizes that minimize overhead. + /// Connections preferring throughput will use large record sizes that minimize overhead. /// /// Corresponds to [s2n_connection_prefer_throughput]. pub fn prefer_throughput(&mut self) -> Result<&mut Self, Error> { @@ -672,7 +672,7 @@ impl Connection { /// 0 bytes returned indicates EOF due to connection closure. /// /// Safety: this function is always safe to call, and additionally: - /// 1. It will never deinitialize any bytes in `buf`. + /// 1. It will never uninitialize any bytes in `buf`. /// 2. If it returns `Ok(n)`, then the first `n` bytes of `buf` /// will have been initialized by this function. /// @@ -737,7 +737,7 @@ impl Connection { /// Attempts a graceful shutdown of the write side of a TLS connection. /// - /// Unlike Self::poll_shutdown, no reponse from the peer is necessary. + /// Unlike Self::poll_shutdown, no response from the peer is necessary. /// If using TLS1.3, the connection can continue to be used for reading afterwards. /// /// Corresponds to [s2n_shutdown_send]. @@ -834,7 +834,7 @@ impl Connection { if let Some(waker) = waker { if let Some(prev_waker) = ctx.waker.as_mut() { - // only replace the Waker if they dont reference the same task + // only replace the Waker if they don't reference the same task if !prev_waker.will_wake(waker) { prev_waker.clone_from(waker); } diff --git a/bindings/rust/extended/s2n-tls/src/error.rs b/bindings/rust/extended/s2n-tls/src/error.rs index 60120cb6ebd..7312f4c1342 100644 --- a/bindings/rust/extended/s2n-tls/src/error.rs +++ b/bindings/rust/extended/s2n-tls/src/error.rs @@ -175,7 +175,7 @@ impl Error { Self(Context::Application(error)) } - /// An error occured while running bindings code. + /// An error occurred while running bindings code. pub(crate) const fn bindings( kind: ErrorType, name: &'static str, diff --git a/bindings/rust/extended/s2n-tls/src/fingerprint.rs b/bindings/rust/extended/s2n-tls/src/fingerprint.rs index 88ca58acbba..36232afa640 100644 --- a/bindings/rust/extended/s2n-tls/src/fingerprint.rs +++ b/bindings/rust/extended/s2n-tls/src/fingerprint.rs @@ -164,7 +164,7 @@ impl Drop for Fingerprint<'_> { /// /// The `Builder` can build a new [Fingerprint] as soon as the old [Fingerprint] /// goes out of scope. The [Fingerprint] implementation of [`Self::drop()`] ensures that this -/// is safe by reseting the underlying C structure. +/// is safe by resetting the underlying C structure. /// /// See the below example: /// ```no_run diff --git a/bindings/rust/extended/s2n-tls/src/pool.rs b/bindings/rust/extended/s2n-tls/src/pool.rs index deb999d7011..209e1c21438 100644 --- a/bindings/rust/extended/s2n-tls/src/pool.rs +++ b/bindings/rust/extended/s2n-tls/src/pool.rs @@ -316,7 +316,7 @@ mod tests { #[test] fn non_generic_pool() -> Result<(), Box> { let config_pool = ConfigPoolBuilder::new(Mode::Server, Config::default()).build(); - // Note the unweildy type parameters on PooledConnection here. + // Note the unwieldy type parameters on PooledConnection here. let _: PooledConnection = PooledConnection::new(&config_pool)?; // To avoid specifying the generic type parameters on PooledConnection, // the pool can be converted to an Arc. diff --git a/bindings/rust/extended/s2n-tls/src/renegotiate.rs b/bindings/rust/extended/s2n-tls/src/renegotiate.rs index 111866edcca..215ca630c42 100644 --- a/bindings/rust/extended/s2n-tls/src/renegotiate.rs +++ b/bindings/rust/extended/s2n-tls/src/renegotiate.rs @@ -748,7 +748,7 @@ mod tests { pair.handshake().expect("Initial handshake"); pair.send_renegotiate_request() .expect("Server sends request"); - // s2n-tls doesn't fail when it rejects renegotiatation, it just sends + // s2n-tls doesn't fail when it rejects renegotiation, it just sends // a warning alert. The peer chooses how to handle that alert. // The openssl server receives the alert on its next read. // Openssl considers the alert an error. diff --git a/bindings/rust/extended/s2n-tls/src/testing/s2n_tls.rs b/bindings/rust/extended/s2n-tls/src/testing/s2n_tls.rs index a82a6358f34..9a964009aa1 100644 --- a/bindings/rust/extended/s2n-tls/src/testing/s2n_tls.rs +++ b/bindings/rust/extended/s2n-tls/src/testing/s2n_tls.rs @@ -115,7 +115,7 @@ mod tests { } #[test] - fn connnection_waker() { + fn connection_waker() { let config = build_config(&security::DEFAULT_TLS13).unwrap(); assert_eq!(config.test_get_refcount().unwrap(), 1);