aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-02-23 02:53:56 -0500
committerJesse Luehrs <doy@tozt.net>2022-02-23 02:53:56 -0500
commit4f0b0ae8d1e3ff3c3af616e88ee7c51e583743b1 (patch)
treeaf881d51c4853786d9cd815351b9ecce8c42a351
parent2b48b4b867a89fd134434437adee708c2a1a0043 (diff)
downloadttyrec-4f0b0ae8d1e3ff3c3af616e88ee7c51e583743b1.tar.gz
ttyrec-4f0b0ae8d1e3ff3c3af616e88ee7c51e583743b1.zip
move to tokio
-rw-r--r--CHANGELOG.md6
-rw-r--r--Cargo.toml6
-rw-r--r--src/lib.rs6
-rw-r--r--src/reader.rs6
-rw-r--r--src/writer.rs6
5 files changed, 18 insertions, 12 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f0a9293..035e9f5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog
+## [Unreleased]
+
+### Changed
+
+* moved to tokio
+
## [0.3.3] - 2021-12-15
### Fixed
diff --git a/Cargo.toml b/Cargo.toml
index db0dfd2..b978000 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,8 +13,8 @@ categories = ["parser-implementations"]
include = ["src/**/*", "LICENSE", "README.md", "CHANGELOG.md"]
[dependencies]
-futures-lite = { version = "1.12.0", optional = true }
+tokio = { version = "1.17.0", optional = true, features = ["io-util"] }
[features]
-default = ["async"]
-async = ["futures-lite"]
+default = []
+async = ["tokio"]
diff --git a/src/lib.rs b/src/lib.rs
index d4ead83..8ef8552 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -7,9 +7,9 @@
//! `blocking::Writer` provide a similar API for non-asynchronous
//! applications.
//!
-//! If you do not need the async API, the `futures` dependency can be removed
-//! by building with `default_features = false` (by default, the `"async"`
-//! feature is enabled).
+//! # Features
+//!
+//! Async support via Tokio can be enabled via the `"async"` feature.
#![warn(clippy::cargo)]
#![warn(clippy::pedantic)]
diff --git a/src/reader.rs b/src/reader.rs
index 3426dcb..0b0666b 100644
--- a/src/reader.rs
+++ b/src/reader.rs
@@ -1,13 +1,13 @@
-use futures_lite::io::AsyncReadExt as _;
+use tokio::io::AsyncReadExt as _;
/// Reads ttyrec frames from a [`futures_lite::io::AsyncRead`] instance.
-pub struct Reader<T: futures_lite::io::AsyncRead> {
+pub struct Reader<T: tokio::io::AsyncRead> {
input: T,
parser: crate::Parser,
buf: [u8; 4096],
}
-impl<T: futures_lite::io::AsyncRead + std::marker::Unpin + Send> Reader<T> {
+impl<T: tokio::io::AsyncRead + std::marker::Unpin + Send> Reader<T> {
/// Creates a new [`Reader`](Self) from a [`futures_lite::io::AsyncRead`]
/// instance.
pub fn new(input: T) -> Self {
diff --git a/src/writer.rs b/src/writer.rs
index 9eb3aaa..6e52db1 100644
--- a/src/writer.rs
+++ b/src/writer.rs
@@ -1,12 +1,12 @@
-use futures_lite::io::AsyncWriteExt as _;
+use tokio::io::AsyncWriteExt as _;
/// Writes ttyrec frames to a [`futures_lite::io::AsyncWrite`] instance.
-pub struct Writer<T: futures_lite::io::AsyncWrite> {
+pub struct Writer<T: tokio::io::AsyncWrite> {
output: T,
creator: crate::Creator,
}
-impl<T: futures_lite::io::AsyncWrite + std::marker::Unpin + Send> Writer<T> {
+impl<T: tokio::io::AsyncWrite + std::marker::Unpin + Send> Writer<T> {
/// Creates a new [`Writer`](Self) from a [`futures_lite::io::AsyncWrite`]
/// instance.
pub fn new(output: T) -> Self {