From bed1f0e2ece8abf61efbb72488287effbeff6d7a Mon Sep 17 00:00:00 2001 From: "Carson M." Date: Mon, 28 Oct 2024 16:48:59 -0500 Subject: [PATCH] refactor: replace `tokio-stream` with `futures-core` This conveniently isn't breaking, because `tokio_stream::Stream` was simply a re-export of `futures_core::Stream`. --- Cargo.toml | 3 ++- examples/marionette.rs | 2 +- examples/recorder.rs | 2 +- src/lib.rs | 2 +- src/udp.rs | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f00ad2e..90eb51f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,13 +23,14 @@ glam = "0.29" nom = { version = "7.1", default-features = false, features = [ "alloc" ] } serde = { version = "1.0", optional = true, features = [ "derive" ] } tokio = { version = "1.30", features = [ "net" ] } -tokio-stream = "0.1" +futures-core = "0.3" thiserror = "1.0" [dev-dependencies] glam = { version = "0.29", features = [ "approx" ] } tokio = { version = "1.30", features = [ "net", "macros", "signal", "rt-multi-thread" ] } tokio-test = "0.4" +futures-util = "0.3" approx = "0.5" rmp-serde = "1.1" console = "0.15" diff --git a/examples/marionette.rs b/examples/marionette.rs index 541e8c2..4eb3ea5 100644 --- a/examples/marionette.rs +++ b/examples/marionette.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use tokio_stream::StreamExt; +use futures_util::StreamExt; use vmc::{VMCMessage, VMCModelState, VMCResult}; #[tokio::main] diff --git a/examples/recorder.rs b/examples/recorder.rs index 6a14941..8ead81c 100644 --- a/examples/recorder.rs +++ b/examples/recorder.rs @@ -4,8 +4,8 @@ use std::sync::{ }; use console::Term; +use futures_util::StreamExt; use serde::Serialize; -use tokio_stream::StreamExt; use vmc::{VMCMessage, VMCResult}; #[derive(Default, Serialize)] diff --git a/src/lib.rs b/src/lib.rs index 107edeb..d8be55c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -66,8 +66,8 @@ use std::{ task::{Context, Poll} }; +use futures_core::Stream; use tokio::net::{ToSocketAddrs, UdpSocket}; -use tokio_stream::Stream; mod error; pub mod message; diff --git a/src/udp.rs b/src/udp.rs index 21b27d1..b7a098d 100644 --- a/src/udp.rs +++ b/src/udp.rs @@ -8,8 +8,8 @@ use std::{ task::{Context, Poll} }; +use futures_core::Stream; use tokio::net::UdpSocket; -use tokio_stream::Stream; pub(crate) type RecvFuture = Pin, usize, SocketAddr)>> + Send + Sync>>;