Skip to content

Commit f0c4370

Browse files
committed
switch to anymap3
see rust-lang/rust#127323 for context, this is a drop in futureproofing measure
1 parent 16c6c58 commit f0c4370

File tree

3 files changed

+61
-46
lines changed

3 files changed

+61
-46
lines changed

Cargo.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+54-39
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,34 @@ repository = "https://github.com/robbert-vdh/nih-plug"
1313
[workspace]
1414
resolver = "2"
1515
members = [
16-
"nih_plug_derive",
17-
"nih_plug_egui",
18-
"nih_plug_iced",
19-
"nih_plug_vizia",
20-
"nih_plug_xtask",
21-
22-
"cargo_nih_plug",
23-
"xtask",
24-
25-
"plugins/examples/gain",
26-
"plugins/examples/gain_gui_egui",
27-
"plugins/examples/gain_gui_iced",
28-
"plugins/examples/gain_gui_vizia",
29-
"plugins/examples/midi_inverter",
30-
"plugins/examples/poly_mod_synth",
31-
"plugins/examples/sine",
32-
"plugins/examples/stft",
33-
"plugins/examples/sysex",
34-
35-
"plugins/soft_vacuum",
36-
"plugins/buffr_glitch",
37-
"plugins/crisp",
38-
"plugins/crossover",
39-
"plugins/diopser",
40-
"plugins/loudness_war_winner",
41-
"plugins/puberty_simulator",
42-
"plugins/safety_limiter",
43-
"plugins/spectral_compressor",
16+
"nih_plug_derive",
17+
"nih_plug_egui",
18+
"nih_plug_iced",
19+
"nih_plug_vizia",
20+
"nih_plug_xtask",
21+
22+
"cargo_nih_plug",
23+
"xtask",
24+
25+
"plugins/examples/gain",
26+
"plugins/examples/gain_gui_egui",
27+
"plugins/examples/gain_gui_iced",
28+
"plugins/examples/gain_gui_vizia",
29+
"plugins/examples/midi_inverter",
30+
"plugins/examples/poly_mod_synth",
31+
"plugins/examples/sine",
32+
"plugins/examples/stft",
33+
"plugins/examples/sysex",
34+
35+
"plugins/soft_vacuum",
36+
"plugins/buffr_glitch",
37+
"plugins/crisp",
38+
"plugins/crossover",
39+
"plugins/diopser",
40+
"plugins/loudness_war_winner",
41+
"plugins/puberty_simulator",
42+
"plugins/safety_limiter",
43+
"plugins/spectral_compressor",
4444
]
4545

4646
[features]
@@ -54,7 +54,14 @@ assert_process_allocs = ["dep:assert_no_alloc"]
5454
# Enables an export target for standalone binaries through the
5555
# `nih_export_standalone()` function. Disabled by default as this requires
5656
# building additional dependencies for audio and MIDI handling.
57-
standalone = ["dep:baseview", "dep:clap", "dep:cpal", "dep:jack", "dep:midir", "dep:rtrb"]
57+
standalone = [
58+
"dep:baseview",
59+
"dep:clap",
60+
"dep:cpal",
61+
"dep:jack",
62+
"dep:midir",
63+
"dep:rtrb",
64+
]
5865
# Enables the `nih_export_vst3!()` macro. Enabled by default. This feature
5966
# exists mostly for GPL-compliance reasons, since even if you don't use the VST3
6067
# wrapper you might otherwise still include a couple (unused) symbols from the
@@ -76,14 +83,14 @@ docs = []
7683
nih_plug_derive = { path = "nih_plug_derive" }
7784

7885
anyhow = "1.0"
79-
anymap = "1.0.0-beta.2"
86+
anymap3 = "1.0.1"
8087
atomic_float = "0.1"
8188
atomic_refcell = "0.1"
8289
backtrace = "0.3.65"
8390
bitflags = "1.3"
8491
cfg-if = "1.0"
8592
# This supports CLAP 1.1.8
86-
clap-sys = { git = "https://github.com/robbert-vdh/clap-sys.git", branch = "feature/cstr-macro" }
93+
clap-sys = { git = "https://github.com/robbert-vdh/clap-sys.git", branch = "feature/cstr-macro" }
8794
crossbeam = "0.8"
8895
log = { version = "0.4", features = ["std", "release_max_level_info"] }
8996
midi-consts = "0.1"
@@ -95,14 +102,22 @@ serde_json = "1.0"
95102
widestring = "1.0.0-beta.1"
96103

97104
# Used for the `assert_process_allocs` feature
98-
assert_no_alloc = { git = "https://github.com/robbert-vdh/rust-assert-no-alloc.git", branch = "feature/nested-permit-forbid", features = ["backtrace", "log"], optional = true }
105+
assert_no_alloc = { git = "https://github.com/robbert-vdh/rust-assert-no-alloc.git", branch = "feature/nested-permit-forbid", features = [
106+
"backtrace",
107+
"log",
108+
], optional = true }
99109

100110
# Used for the `standalone` feature
101111
# NOTE: OpenGL support is not needed here, but rust-analyzer gets confused when
102112
# some crates do use it and others don't
103-
baseview = { git = "https://github.com/RustAudio/baseview.git", rev = "579130ecb4f9f315ae52190af42f0ea46aeaa4a2", features = ["opengl"], optional = true }
113+
baseview = { git = "https://github.com/RustAudio/baseview.git", rev = "579130ecb4f9f315ae52190af42f0ea46aeaa4a2", features = [
114+
"opengl",
115+
], optional = true }
104116
# All the claps!
105-
clap = { version = "4.1.8", features = ["derive", "wrap_help"], optional = true }
117+
clap = { version = "4.1.8", features = [
118+
"derive",
119+
"wrap_help",
120+
], optional = true }
106121
cpal = { version = "0.15", optional = true }
107122
jack = { version = "0.11.4", optional = true }
108123
midir = { version = "0.9.1", optional = true }
@@ -127,11 +142,11 @@ core-foundation = "0.9.3"
127142
[target.'cfg(target_os = "windows")'.dependencies.windows]
128143
version = "0.44"
129144
features = [
130-
"Win32_Foundation",
131-
"Win32_Graphics_Gdi",
132-
"Win32_UI_WindowsAndMessaging",
133-
"Win32_System_LibraryLoader",
134-
"Win32_System_Performance",
145+
"Win32_Foundation",
146+
"Win32_Graphics_Gdi",
147+
"Win32_UI_WindowsAndMessaging",
148+
"Win32_System_LibraryLoader",
149+
"Win32_System_Performance",
135150
]
136151

137152
[profile.release]

src/event_loop/background_thread.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//!
44
//! This is essentially a slimmed down version of the `LinuxEventLoop`.
55
6-
use anymap::Entry;
6+
use anymap3::Entry;
77
use crossbeam::channel;
88
use parking_lot::Mutex;
99
use std::sync::{Arc, LazyLock, Weak};
@@ -73,8 +73,8 @@ where
7373
// Rust does not allow us to use the `T` and `E` type variable in statics, so this is a
7474
// workaround to have a singleton that also works if for whatever reason there arem ultiple `T`
7575
// and `E`s in a single process (won't happen with normal plugin usage, but sho knwos).
76-
static HANDLE_MAP: LazyLock<Mutex<anymap::Map<dyn std::any::Any + Send>>> =
77-
LazyLock::new(|| Mutex::new(anymap::Map::new()));
76+
static HANDLE_MAP: LazyLock<Mutex<anymap3::Map<dyn std::any::Any + Send>>> =
77+
LazyLock::new(|| Mutex::new(anymap3::Map::new()));
7878

7979
impl<T: Send + 'static, E: MainThreadExecutor<T> + 'static> WorkerThread<T, E> {
8080
fn spawn() -> Self {

0 commit comments

Comments
 (0)