From 72d88c2c910834d11301cef51ac2faf4ef70c8be Mon Sep 17 00:00:00 2001 From: SirCipher Date: Thu, 25 Jul 2024 13:26:23 +0100 Subject: [PATCH 1/2] Update to Rust 1.80.0 --- .github/workflows/ci.yml | 2 +- ratchet_core/src/split/bilock/mod.rs | 6 +++--- ratchet_rs/examples/server.rs | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48800cf..0bc381d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.78.0 + toolchain: 1.80.0 - uses: Swatinem/rust-cache@v2 - name: Test run: cargo test --all-features --all-targets --workspace diff --git a/ratchet_core/src/split/bilock/mod.rs b/ratchet_core/src/split/bilock/mod.rs index 35f367b..6df98df 100644 --- a/ratchet_core/src/split/bilock/mod.rs +++ b/ratchet_core/src/split/bilock/mod.rs @@ -96,7 +96,7 @@ impl BiLock { /// Reunites two `BiLock`s that form a pair or returns an error if they do not guard the same /// value. - pub fn reunite(self, other: BiLock) -> Result> + pub fn reunite(self, other: BiLock) -> Result>> where T: Unpin, { @@ -151,7 +151,7 @@ impl DerefMut for BiLockGuard<'_, T> { } } -pub struct ReuniteError(pub BiLock, pub BiLock); +pub struct ReuniteError(pub T, pub T); impl Debug for ReuniteError { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { @@ -160,7 +160,7 @@ impl Debug for ReuniteError { } impl Display for ReuniteError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "Attempted to reunite two BiLocks that don't form a pair") } } diff --git a/ratchet_rs/examples/server.rs b/ratchet_rs/examples/server.rs index 67eaede..f1c84dd 100644 --- a/ratchet_rs/examples/server.rs +++ b/ratchet_rs/examples/server.rs @@ -17,8 +17,7 @@ use ratchet_rs::{ Error, Message, NoExtProvider, PayloadType, ProtocolRegistry, UpgradedServer, WebSocketConfig, }; use tokio::net::TcpListener; -use tokio_stream::wrappers::TcpListenerStream; -use tokio_stream::StreamExt; +use tokio_stream::{wrappers::TcpListenerStream, StreamExt}; #[tokio::main] async fn main() -> Result<(), Error> { From b31f788c25f367bd3192d37463dd3fa1f805141e Mon Sep 17 00:00:00 2001 From: SirCipher Date: Thu, 25 Jul 2024 13:26:23 +0100 Subject: [PATCH 2/2] Update to Rust 1.80.0 --- .github/workflows/ci.yml | 2 +- ratchet_core/src/split/bilock/mod.rs | 6 +++--- ratchet_rs/examples/server.rs | 3 +-- ratchet_rs/src/lib.rs | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48800cf..0bc381d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.78.0 + toolchain: 1.80.0 - uses: Swatinem/rust-cache@v2 - name: Test run: cargo test --all-features --all-targets --workspace diff --git a/ratchet_core/src/split/bilock/mod.rs b/ratchet_core/src/split/bilock/mod.rs index 35f367b..6df98df 100644 --- a/ratchet_core/src/split/bilock/mod.rs +++ b/ratchet_core/src/split/bilock/mod.rs @@ -96,7 +96,7 @@ impl BiLock { /// Reunites two `BiLock`s that form a pair or returns an error if they do not guard the same /// value. - pub fn reunite(self, other: BiLock) -> Result> + pub fn reunite(self, other: BiLock) -> Result>> where T: Unpin, { @@ -151,7 +151,7 @@ impl DerefMut for BiLockGuard<'_, T> { } } -pub struct ReuniteError(pub BiLock, pub BiLock); +pub struct ReuniteError(pub T, pub T); impl Debug for ReuniteError { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { @@ -160,7 +160,7 @@ impl Debug for ReuniteError { } impl Display for ReuniteError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "Attempted to reunite two BiLocks that don't form a pair") } } diff --git a/ratchet_rs/examples/server.rs b/ratchet_rs/examples/server.rs index 67eaede..f1c84dd 100644 --- a/ratchet_rs/examples/server.rs +++ b/ratchet_rs/examples/server.rs @@ -17,8 +17,7 @@ use ratchet_rs::{ Error, Message, NoExtProvider, PayloadType, ProtocolRegistry, UpgradedServer, WebSocketConfig, }; use tokio::net::TcpListener; -use tokio_stream::wrappers::TcpListenerStream; -use tokio_stream::StreamExt; +use tokio_stream::{wrappers::TcpListenerStream, StreamExt}; #[tokio::main] async fn main() -> Result<(), Error> { diff --git a/ratchet_rs/src/lib.rs b/ratchet_rs/src/lib.rs index 030e3fb..f2af7fa 100644 --- a/ratchet_rs/src/lib.rs +++ b/ratchet_rs/src/lib.rs @@ -19,7 +19,7 @@ //! # Features //! - Implement your own own extensions using [ratchet_ext](../ratchet_ext). //! - Per-message deflate with [ratchet_deflate](../ratchet_deflate) or enable with the `deflate` -//! feature. +//! feature. //! - Split WebSocket with the `split` feature. //! //! # Error handling