Skip to content

Commit

Permalink
Split futures dependency into futures-core and futures-util
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Jan 2, 2024
1 parent 64f07d9 commit cc163b4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .justfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ setup:
# Upgrade (and update) dependencies
upgrade: setup
pre-commit autoupdate
cargo upgrade --incompatible
cargo upgrade --incompatible --pinned
cargo update

# Run pre-commit hooks
Expand Down
15 changes: 9 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[package]
name = "djio"
description = "DJ Hardware Control(ler) Support"
version = "0.0.18"
version = "0.0.19"
license = "MPL-2.0"
readme = "README.md"
repository = "https://github.com/uklotzde/djio"
Expand All @@ -15,17 +15,20 @@ edition = "2021"
include = ["/src", "/README.md", "/LICENSES"]

[dependencies]
anyhow = "1.0.78"
anyhow = "1.0.79"
derive_more = "0.99.17"
float-cmp = "0.9.0"
futures = { version = "0.3.30", default-features = false, features = ["std"] }
futures-core = { version = "0.3.30", default-features = false }
futures-util = { version = "0.3.30", default-features = false, features = ["std"] }
# TODO: Replace with std when available.
# Tracking issue for RFC 2351: <https://github.com/rust-lang/rust/issues/53485>
is_sorted = "0.1.1"
log = "0.4.20"
strum = { version = "0.25.0", features = ["derive"] }
thiserror = "1.0.53"
thiserror = "1.0.56"

# Optional dependencies
discro = { version = "0.28.0", optional = true }
discro = { version = "0.28.1", optional = true }
midir = { version = "0.9.1", optional = true }
tokio = { version = "1.35.1", default-features = false, optional = true }

Expand All @@ -38,7 +41,7 @@ enum-as-inner = { version = "0.6.0", optional = true }
hidapi = { version = "2.4.1", optional = true }

[dev-dependencies]
anyhow = "1.0.78"
anyhow = "1.0.79"
hidapi = "2.4.1"
pretty_env_logger = "0.5.0"

Expand Down
2 changes: 1 addition & 1 deletion src/controller/thread.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: The djio authors
// SPDX-License-Identifier: MPL-2.0

use futures::stream::{AbortHandle, Abortable, Aborted};
use futures_util::future::{AbortHandle, Abortable, Aborted};

use super::BoxedControllerTask;

Expand Down
9 changes: 5 additions & 4 deletions src/output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ use std::{
time::Duration,
};

use futures::StreamExt as _;
use futures_core::Stream;
use futures_util::{stream, StreamExt as _};
use strum::FromRepr;
use thiserror::Error;

Expand Down Expand Up @@ -244,9 +245,9 @@ impl BlinkingLedTicker {

pub fn map_into_output_stream(
self,
periodic: impl futures::Stream<Item = ()> + 'static,
) -> impl futures::Stream<Item = BlinkingLedOutput> {
futures::stream::unfold(
periodic: impl Stream<Item = ()> + 'static,
) -> impl Stream<Item = BlinkingLedOutput> {
stream::unfold(
(self, Box::pin(periodic)),
|(mut ticker, mut periodic)| async move {
periodic.next().await.map(|()| {
Expand Down

0 comments on commit cc163b4

Please sign in to comment.