From 5921d9e227b718b5cb4ed0c7092995efe3097fc0 Mon Sep 17 00:00:00 2001 From: Be Date: Sat, 10 Dec 2022 14:18:11 -0600 Subject: [PATCH 1/3] use Cargo workspace.package table This feature was added to Cargo 1.64. --- Cargo.toml | 11 ++++++++++ audio-core/Cargo.toml | 21 +++++++++--------- audio-device-alsa-sys/Cargo.toml | 19 ++++++++-------- audio-device-pipewire-sys/Cargo.toml | 19 ++++++++-------- audio-device-pulse-sys/Cargo.toml | 19 ++++++++-------- audio-device/Cargo.toml | 33 ++++++++++++++-------------- audio-generator/Cargo.toml | 21 +++++++++--------- audio/Cargo.toml | 21 +++++++++--------- ste/Cargo.toml | 12 +++++----- 9 files changed, 90 insertions(+), 86 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5a46b51..c806bc5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,17 @@ default-members = [ "ste", ] +[workspace.package] +version = "0.2.0-alpha.4" +authors = ["John-John Tedro "] +edition = "2018" +documentation = "https://docs.rs/audio" +homepage = "https://github.com/udoprog/audio" +repository = "https://github.com/udoprog/audio" +license = "MIT/Apache-2.0" +keywords = ["audio", "buffer", "dsp"] +categories = ["multimedia::audio"] + [patch.'https://github.com/udoprog/audio'] audio = { path = "audio" } audio-core = { path = "audio-core" } diff --git a/audio-core/Cargo.toml b/audio-core/Cargo.toml index 9a76e1c..bc9a12f 100644 --- a/audio-core/Cargo.toml +++ b/audio-core/Cargo.toml @@ -1,20 +1,19 @@ [package] name = "audio-core" -version = "0.2.0-alpha.4" -authors = ["John-John Tedro "] -edition = "2018" description = "The core audio traits" -documentation = "https://docs.rs/audio" -readme = "README.md" -homepage = "https://github.com/udoprog/audio" -repository = "https://github.com/udoprog/audio" -license = "MIT/Apache-2.0" -keywords = ["audio", "buffer", "dsp"] -categories = ["multimedia::audio"] +version.workspace = true +authors.workspace = true +edition.workspace = true +documentation.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true [features] default = ["std"] std = [] [dev-dependencies] -audio = { version = "0.2.0-alpha.4", path = "../audio" } +audio = { path = "../audio" } diff --git a/audio-device-alsa-sys/Cargo.toml b/audio-device-alsa-sys/Cargo.toml index ed4fc2e..bfa25df 100644 --- a/audio-device-alsa-sys/Cargo.toml +++ b/audio-device-alsa-sys/Cargo.toml @@ -1,16 +1,15 @@ [package] name = "audio-device-alsa-sys" -version = "0.1.0-alpha.1" -authors = ["John-John Tedro "] -edition = "2018" description = "audio-device system bindings for ALSA" -documentation = "https://docs.rs/audio" -readme = "README.md" -homepage = "https://github.com/udoprog/audio" -repository = "https://github.com/udoprog/audio" -license = "MIT/Apache-2.0" -keywords = ["audio", "buffer", "dsp"] -categories = ["multimedia::audio"] +version.workspace = true +authors.workspace = true +edition.workspace = true +documentation.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true [dependencies] libc = "0.2.125" diff --git a/audio-device-pipewire-sys/Cargo.toml b/audio-device-pipewire-sys/Cargo.toml index b7cb1a5..98da378 100644 --- a/audio-device-pipewire-sys/Cargo.toml +++ b/audio-device-pipewire-sys/Cargo.toml @@ -1,16 +1,15 @@ [package] name = "audio-device-pipewire-sys" -version = "0.1.0-alpha.1" -authors = ["John-John Tedro "] -edition = "2018" description = "audio-device system bindings for PipeWire" -documentation = "https://docs.rs/audio" -readme = "README.md" -homepage = "https://github.com/udoprog/audio" -repository = "https://github.com/udoprog/audio" -license = "MIT/Apache-2.0" -keywords = ["audio", "buffer", "dsp"] -categories = ["multimedia::audio"] +version.workspace = true +authors.workspace = true +edition.workspace = true +documentation.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true [dependencies] libc = "0.2.125" diff --git a/audio-device-pulse-sys/Cargo.toml b/audio-device-pulse-sys/Cargo.toml index bd5a7b6..95fde79 100644 --- a/audio-device-pulse-sys/Cargo.toml +++ b/audio-device-pulse-sys/Cargo.toml @@ -1,16 +1,15 @@ [package] name = "audio-device-pulse-sys" -version = "0.1.0-alpha.1" -authors = ["John-John Tedro "] -edition = "2018" description = "audio-device system bindings for PulseAudio" -documentation = "https://docs.rs/audio" -readme = "README.md" -homepage = "https://github.com/udoprog/audio" -repository = "https://github.com/udoprog/audio" -license = "MIT/Apache-2.0" -keywords = ["audio", "buffer", "dsp"] -categories = ["multimedia::audio"] +version.workspace = true +authors.workspace = true +edition.workspace = true +documentation.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true [dependencies] libc = "0.2.125" diff --git a/audio-device/Cargo.toml b/audio-device/Cargo.toml index 213f0dc..be0be3f 100644 --- a/audio-device/Cargo.toml +++ b/audio-device/Cargo.toml @@ -1,16 +1,15 @@ [package] name = "audio-device" -version = "0.1.0-alpha.6" -authors = ["John-John Tedro "] -edition = "2018" description = "A library for interacting with audio devices" -documentation = "https://docs.rs/audio" -readme = "README.md" -homepage = "https://github.com/udoprog/audio" -repository = "https://github.com/udoprog/audio" -license = "MIT/Apache-2.0" -keywords = ["audio", "buffer", "dsp"] -categories = ["multimedia::audio"] +version.workspace = true +authors.workspace = true +edition.workspace = true +documentation.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true autoexamples = false @@ -42,21 +41,21 @@ wasapi = [ [dependencies] tracing = "0.1.36" -audio-core = { version = "0.2.0-alpha.4", path = "../audio-core" } +audio-core = { path = "../audio-core" } thiserror = "1.0.31" rand = "0.8.5" -ste = { version = "0.1.0-alpha.9", path = "../ste" } +ste = { path = "../ste" } -pulse-sys = { package = "audio-device-pulse-sys", version = "0.1.0-alpha.1", path = "../audio-device-pulse-sys", optional = true } -pipewire-sys = { package = "audio-device-pipewire-sys", version = "0.1.0-alpha.1", path = "../audio-device-pipewire-sys", optional = true } +pulse-sys = { package = "audio-device-pulse-sys", path = "../audio-device-pulse-sys", optional = true } +pipewire-sys = { package = "audio-device-pipewire-sys", path = "../audio-device-pipewire-sys", optional = true } # unix -alsa-sys = { package = "audio-device-alsa-sys", version = "0.1.0-alpha.1", path = "../audio-device-alsa-sys", optional = true } +alsa-sys = { package = "audio-device-alsa-sys", path = "../audio-device-alsa-sys", optional = true } libc = { version = "0.2.125", optional = true } [dev-dependencies] -audio = { version = "0.2.0-alpha.4", path = "../audio" } -audio-generator = { version = "0.1.0-alpha.2", path = "../audio-generator" } +audio = { path = "../audio" } +audio-generator = { path = "../audio-generator" } anyhow = "1.0.57" tokio = { version = "1.18.1", features = ["full"] } tracing-subscriber = { version = "0.3.3", features = ["env-filter"] } diff --git a/audio-generator/Cargo.toml b/audio-generator/Cargo.toml index 1037be9..35c72cc 100644 --- a/audio-generator/Cargo.toml +++ b/audio-generator/Cargo.toml @@ -1,16 +1,15 @@ [package] name = "audio-generator" -version = "0.1.0-alpha.2" -authors = ["John-John Tedro "] -edition = "2018" description = "Audio generator APIs" -documentation = "https://docs.rs/audio" -readme = "README.md" -homepage = "https://github.com/udoprog/audio" -repository = "https://github.com/udoprog/audio" -license = "MIT/Apache-2.0" -keywords = ["audio", "buffer", "dsp"] -categories = ["multimedia::audio"] +version.workspace = true +authors.workspace = true +edition.workspace = true +documentation.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true [dependencies] -audio-core = { version = "0.2.0-alpha.4", path = "../audio-core" } +audio-core = { path = "../audio-core" } diff --git a/audio/Cargo.toml b/audio/Cargo.toml index 09bc399..2f6ea77 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -1,23 +1,22 @@ [package] name = "audio" -version = "0.2.0-alpha.4" -authors = ["John-John Tedro "] -edition = "2018" description = "A crate for working with audio in Rust" -documentation = "https://docs.rs/audio" -readme = "README.md" -homepage = "https://github.com/udoprog/audio" -repository = "https://github.com/udoprog/audio" -license = "MIT/Apache-2.0" -keywords = ["audio", "buffer", "dsp"] -categories = ["multimedia::audio"] +version.workspace = true +authors.workspace = true +edition.workspace = true +documentation.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true [features] default = ["std"] std = ["audio-core/std"] [dependencies] -audio-core = { version = "0.2.0-alpha.4", path = "../audio-core" } +audio-core = { path = "../audio-core" } [dev-dependencies] rand = "0.8.5" diff --git a/ste/Cargo.toml b/ste/Cargo.toml index 6e014cf..c3a6afe 100644 --- a/ste/Cargo.toml +++ b/ste/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "ste" -version = "0.1.0-alpha.11" -authors = ["John-John Tedro "] -edition = "2018" description = "A single-threaded executor with some tricks up its sleeve." documentation = "https://docs.rs/audio" readme = "README.md" -homepage = "https://github.com/udoprog/audio" -repository = "https://github.com/udoprog/audio" -license = "MIT/Apache-2.0" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true keywords = ["executor", "thread"] categories = ["concurrency"] From e1dac57b458732f609e2a086dd51a3bcea164619 Mon Sep 17 00:00:00 2001 From: Be Date: Sat, 10 Dec 2022 14:22:25 -0600 Subject: [PATCH 2/3] specify rust-version in Cargo.tomls --- Cargo.toml | 2 ++ audio-core/Cargo.toml | 1 + audio-device-alsa-sys/Cargo.toml | 1 + audio-device-pipewire-sys/Cargo.toml | 1 + audio-device-pulse-sys/Cargo.toml | 1 + audio-device/Cargo.toml | 1 + audio-generator/Cargo.toml | 1 + audio/Cargo.toml | 1 + ste/Cargo.toml | 1 + 9 files changed, 10 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index c806bc5..bd737d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,8 @@ default-members = [ [workspace.package] version = "0.2.0-alpha.4" authors = ["John-John Tedro "] +# Generic associated types were stabilized in 1.65. +rust-version = "1.65" edition = "2018" documentation = "https://docs.rs/audio" homepage = "https://github.com/udoprog/audio" diff --git a/audio-core/Cargo.toml b/audio-core/Cargo.toml index bc9a12f..8e4c1ad 100644 --- a/audio-core/Cargo.toml +++ b/audio-core/Cargo.toml @@ -3,6 +3,7 @@ name = "audio-core" description = "The core audio traits" version.workspace = true authors.workspace = true +rust-version.workspace = true edition.workspace = true documentation.workspace = true homepage.workspace = true diff --git a/audio-device-alsa-sys/Cargo.toml b/audio-device-alsa-sys/Cargo.toml index bfa25df..a5584a1 100644 --- a/audio-device-alsa-sys/Cargo.toml +++ b/audio-device-alsa-sys/Cargo.toml @@ -3,6 +3,7 @@ name = "audio-device-alsa-sys" description = "audio-device system bindings for ALSA" version.workspace = true authors.workspace = true +rust-version.workspace = true edition.workspace = true documentation.workspace = true homepage.workspace = true diff --git a/audio-device-pipewire-sys/Cargo.toml b/audio-device-pipewire-sys/Cargo.toml index 98da378..b022550 100644 --- a/audio-device-pipewire-sys/Cargo.toml +++ b/audio-device-pipewire-sys/Cargo.toml @@ -3,6 +3,7 @@ name = "audio-device-pipewire-sys" description = "audio-device system bindings for PipeWire" version.workspace = true authors.workspace = true +rust-version.workspace = true edition.workspace = true documentation.workspace = true homepage.workspace = true diff --git a/audio-device-pulse-sys/Cargo.toml b/audio-device-pulse-sys/Cargo.toml index 95fde79..7ee97c2 100644 --- a/audio-device-pulse-sys/Cargo.toml +++ b/audio-device-pulse-sys/Cargo.toml @@ -3,6 +3,7 @@ name = "audio-device-pulse-sys" description = "audio-device system bindings for PulseAudio" version.workspace = true authors.workspace = true +rust-version.workspace = true edition.workspace = true documentation.workspace = true homepage.workspace = true diff --git a/audio-device/Cargo.toml b/audio-device/Cargo.toml index be0be3f..efa2060 100644 --- a/audio-device/Cargo.toml +++ b/audio-device/Cargo.toml @@ -3,6 +3,7 @@ name = "audio-device" description = "A library for interacting with audio devices" version.workspace = true authors.workspace = true +rust-version.workspace = true edition.workspace = true documentation.workspace = true homepage.workspace = true diff --git a/audio-generator/Cargo.toml b/audio-generator/Cargo.toml index 35c72cc..072aec1 100644 --- a/audio-generator/Cargo.toml +++ b/audio-generator/Cargo.toml @@ -3,6 +3,7 @@ name = "audio-generator" description = "Audio generator APIs" version.workspace = true authors.workspace = true +rust-version.workspace = true edition.workspace = true documentation.workspace = true homepage.workspace = true diff --git a/audio/Cargo.toml b/audio/Cargo.toml index 2f6ea77..f56fe1b 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -3,6 +3,7 @@ name = "audio" description = "A crate for working with audio in Rust" version.workspace = true authors.workspace = true +rust-version.workspace = true edition.workspace = true documentation.workspace = true homepage.workspace = true diff --git a/ste/Cargo.toml b/ste/Cargo.toml index c3a6afe..ce4ec46 100644 --- a/ste/Cargo.toml +++ b/ste/Cargo.toml @@ -5,6 +5,7 @@ documentation = "https://docs.rs/audio" readme = "README.md" version.workspace = true authors.workspace = true +rust-version.workspace = true edition.workspace = true homepage.workspace = true repository.workspace = true From 68e856cbdbe64ae83c2bcc395188273e14df979e Mon Sep 17 00:00:00 2001 From: Be Date: Sat, 10 Dec 2022 14:35:04 -0600 Subject: [PATCH 3/3] update to Rust 2021 --- Cargo.toml | 2 +- examples/Cargo.toml | 2 +- generate/Cargo.toml | 2 +- ste/src/lib.rs | 2 ++ ste/src/wait_future.rs | 2 ++ 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bd737d6..1cee089 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ version = "0.2.0-alpha.4" authors = ["John-John Tedro "] # Generic associated types were stabilized in 1.65. rust-version = "1.65" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/audio" homepage = "https://github.com/udoprog/audio" repository = "https://github.com/udoprog/audio" diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 8083f3f..ce5a310 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -2,7 +2,7 @@ name = "examples" version = "0.0.0" authors = ["John-John Tedro "] -edition = "2018" +edition.workspace = true publish = false [dependencies] diff --git a/generate/Cargo.toml b/generate/Cargo.toml index 1a3af39..8323afd 100644 --- a/generate/Cargo.toml +++ b/generate/Cargo.toml @@ -2,7 +2,7 @@ name = "generate" version = "0.0.0" authors = ["John-John Tedro "] -edition = "2018" +edition.workspace = true publish = false [dependencies] diff --git a/ste/src/lib.rs b/ste/src/lib.rs index 8c3c34b..b402216 100644 --- a/ste/src/lib.rs +++ b/ste/src/lib.rs @@ -342,6 +342,7 @@ impl Thread { move |tag| { if let Some(task) = task.take() { let _ = panic::catch_unwind(panic::AssertUnwindSafe(|| { + let _ = &storage; let output = with_tag(tag, task); // Safety: we're the only one with access to this pointer, @@ -632,6 +633,7 @@ impl Builder { let handle = thread::Builder::new() .name(String::from("ste-thread")) .spawn(move || { + let _ = &shared2; let RawSend(shared) = shared2; #[cfg(feature = "tokio")] diff --git a/ste/src/wait_future.rs b/ste/src/wait_future.rs index 475b237..75e4251 100644 --- a/ste/src/wait_future.rs +++ b/ste/src/wait_future.rs @@ -72,6 +72,7 @@ where use std::panic; move |tag| { + let _ = (&waker, &future, &complete); unsafe { // Safety: At this point, we know the waker has been // replaced by the polling task and can safely deref it into @@ -82,6 +83,7 @@ where let future = Pin::new_unchecked(future.0.as_mut()); let result = panic::catch_unwind(panic::AssertUnwindSafe(|| { + let _ = &output; if let Poll::Ready(ready) = with_tag(tag, || future.poll(&mut cx)) { *output.0.as_mut() = Some(ready); }