Skip to content

Commit

Permalink
use workspace-shared config for lint and msrv (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
russellmcc authored Feb 10, 2025
1 parent 625ff0a commit f6f219e
Show file tree
Hide file tree
Showing 31 changed files with 175 additions and 226 deletions.
21 changes: 21 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,24 @@ members = [
"rust/core",
"rust/poly",
]

[workspace.package]
rust-version = "1.84.1"

[workspace.lints.rust]
nonstandard_style = "warn"
rust_2018_idioms = "warn"
future_incompatible = "warn"
missing_docs = "warn"

[workspace.lints.rustdoc]
private_doc_tests = "warn"
unescaped_backticks = "warn"

[workspace.lints.clippy]
pedantic = { level = "warn", priority = -1 }
todo = "warn"
type_complexity = "allow"
cast_sign_loss = "allow"
cast_possible_wrap = "allow"
default_trait_access = "allow"
5 changes: 4 additions & 1 deletion rust/component/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
name = "conformal_component"
version = "0.0.0"
edition = "2021"
rust-version = "1.79.0"
rust-version.workspace = true
license = "ISC"
description = "Defines basic audio component abstraction for conformal audio plug-in framework."
repository = "https://github.com/russellmcc/conformal"
documentation = "https://russellmcc.github.io/conformal/rust-doc/conformal_component"
homepage = "https://russellmcc.github.io/conformal"

[lints]
workspace = true

[dependencies]
itertools = "0.13.0"
fxhash = "0.2.1"
4 changes: 2 additions & 2 deletions rust/component/src/audio/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl<B: Buffer, I: BufferIndex> Buffer for SlicedBuffer<'_, B, I> {
pub fn slice_buffer<'a, B: Buffer, I: BufferIndex + 'a>(
buffer: &'a B,
index: I,
) -> impl Buffer + '_ {
) -> impl Buffer + 'a {
let ret = SlicedBuffer { buffer, index };
// Grab the first channel and throw it away - this will
// cause us to panic early in the case of an invalid range
Expand Down Expand Up @@ -202,7 +202,7 @@ impl<B: BufferMut, I: BufferIndex> BufferMut for SlicedMutBuffer<'_, B, I> {
pub fn slice_buffer_mut<'a, B: BufferMut, I: BufferIndex + 'a>(
buffer: &'a mut B,
index: I,
) -> impl BufferMut + '_ {
) -> impl BufferMut + 'a {
let ret = SlicedMutBuffer { buffer, index };
// Grab the first channel and throw it away - this will
// cause us to panic early in the case of an invalid range
Expand Down
16 changes: 0 additions & 16 deletions rust/component/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
#![warn(
nonstandard_style,
rust_2018_idioms,
future_incompatible,
missing_docs,
rustdoc::private_doc_tests,
rustdoc::unescaped_backticks,
clippy::pedantic,
clippy::todo
)]
#![allow(
clippy::type_complexity,
clippy::cast_sign_loss,
clippy::cast_possible_wrap,
clippy::default_trait_access
)]
#![doc = include_str!("../docs_boilerplate.md")]
#![doc = include_str!("../README.md")]

Expand Down
12 changes: 6 additions & 6 deletions rust/component/src/parameters/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1225,44 +1225,44 @@ fn ramp_numeric(
end: f32,
buffer_size: usize,
) -> impl Iterator<Item = PiecewiseLinearCurvePoint> + Clone {
return [0, 1].iter().map(move |i| {
[0, 1].iter().map(move |i| {
let value = if *i == 0 { start } else { end };
let sample_offset = if *i == 0 { 0 } else { buffer_size - 1 };
PiecewiseLinearCurvePoint {
sample_offset,
value,
}
});
})
}

fn ramp_enum(
start: u32,
end: u32,
buffer_size: usize,
) -> impl Iterator<Item = TimedValue<u32>> + Clone {
return [0, 1].iter().map(move |i| {
[0, 1].iter().map(move |i| {
let value = if *i == 0 { start } else { end };
let sample_offset = if *i == 0 { 0 } else { buffer_size / 2 };
TimedValue {
sample_offset,
value,
}
});
})
}

fn ramp_switch(
start: bool,
end: bool,
buffer_size: usize,
) -> impl Iterator<Item = TimedValue<bool>> + Clone {
return [0, 1].iter().map(move |i| {
[0, 1].iter().map(move |i| {
let value = if *i == 0 { start } else { end };
let sample_offset = if *i == 0 { 0 } else { buffer_size / 2 };
TimedValue {
sample_offset,
value,
}
});
})
}

impl BufferStates for RampedStatesMap {
Expand Down
5 changes: 4 additions & 1 deletion rust/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
name = "conformal_core"
version = "0.0.0"
edition = "2021"
rust-version = "1.79.0"
rust-version.workspace = true
license = "ISC"
description = "Code shared between wrappers in conformal framework."
repository = "https://github.com/russellmcc/conformal"
homepage = "https://russellmcc.github.io/conformal"

[lints]
workspace = true

[dependencies]
conformal_component = { version = "0.0.0", path = "../component" }
serde = { version = "1.0.193", features = ["derive"] }
16 changes: 1 addition & 15 deletions rust/core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
#![warn(
nonstandard_style,
rust_2018_idioms,
future_incompatible,
rustdoc::private_doc_tests,
rustdoc::unescaped_backticks,
clippy::pedantic,
clippy::todo
)]
#![allow(
clippy::type_complexity,
clippy::cast_sign_loss,
clippy::cast_possible_wrap,
clippy::default_trait_access
)]
#![allow(missing_docs)]
#![doc = include_str!("../docs_boilerplate.md")]
#![doc = include_str!("../README.md")]

Expand Down
7 changes: 5 additions & 2 deletions rust/macos-bundle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
name = "conformal_macos_bundle"
version = "0.0.0"
edition = "2021"
rust-version = "1.79.0"
rust-version.workspace = true
license = "ISC"
description = "Utilities for macOS bundle directories used by the conformal audio plug-in framework."
repository = "https://github.com/russellmcc/conformal"
homepage = "https://russellmcc.github.io/conformal"

[lints]
workspace = true

[dependencies]
process_path = "0.1.4"
objc = "0.2.7"
objc = "0.2.7"
17 changes: 2 additions & 15 deletions rust/macos-bundle/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
#![warn(
nonstandard_style,
rust_2018_idioms,
future_incompatible,
clippy::pedantic,
clippy::todo
)]
#![allow(
clippy::type_complexity,
clippy::cast_sign_loss,
clippy::cast_possible_wrap,
clippy::default_trait_access
)]
#![doc = include_str!("../docs_boilerplate.md")]
#![doc = include_str!("../README.md")]
#![allow(unexpected_cfgs)]
#![allow(missing_docs)]

use std::{
ffi::{CStr, CString},
Expand Down
5 changes: 4 additions & 1 deletion rust/poly/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
name = "conformal_poly"
version = "0.0.0"
edition = "2021"
rust-version = "1.79.0"
rust-version.workspace = true
license = "ISC"
description = "Helper utilities for polyphonic synthesizers in the conformal framework."
repository = "https://github.com/russellmcc/conformal"
homepage = "https://russellmcc.github.io/conformal"

[lints]
workspace = true

[dependencies]
conformal_component = { version = "0.0.0", path = "../component" }
16 changes: 0 additions & 16 deletions rust/poly/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
#![warn(
nonstandard_style,
rust_2018_idioms,
future_incompatible,
missing_docs,
rustdoc::private_doc_tests,
rustdoc::unescaped_backticks,
clippy::pedantic,
clippy::todo
)]
#![allow(
clippy::type_complexity,
clippy::cast_sign_loss,
clippy::cast_possible_wrap,
clippy::default_trait_access
)]
#![doc = include_str!("../docs_boilerplate.md")]
#![doc = include_str!("../README.md")]

Expand Down
3 changes: 3 additions & 0 deletions rust/preferences/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ homepage = "https://russellmcc.github.io/conformal"
serde = { version = "1.0.193", features = ["derive"] }
serde_json = "1.0.117"

[lints]
workspace = true

[features]
test-utils = []

Expand Down
17 changes: 2 additions & 15 deletions rust/preferences/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
#![warn(
nonstandard_style,
rust_2018_idioms,
future_incompatible,
clippy::pedantic,
clippy::todo
)]
#![allow(
clippy::type_complexity,
clippy::cast_sign_loss,
clippy::cast_possible_wrap,
clippy::default_trait_access
)]
#![doc = include_str!("../docs_boilerplate.md")]
#![doc = include_str!("../README.md")]
#![allow(unexpected_cfgs)]
#![allow(missing_docs)]

use std::collections::HashMap;

Expand Down
9 changes: 7 additions & 2 deletions rust/ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
name = "conformal_ui"
version = "0.0.0"
edition = "2021"
rust-version = "1.79.0"
rust-version.workspace = true
license = "ISC"
description = "Implements a wry-based UI for audio processors. Part of the conformal audio plug-in framework."
repository = "https://github.com/russellmcc/conformal"
homepage = "https://russellmcc.github.io/conformal"

[lints]
workspace = true

[dependencies]
base64 = "0.22.1"
conformal_component = { version = "0.0.0", path = "../component" }
Expand All @@ -23,4 +26,6 @@ mime_guess = "2.0.4"
conformal_macos_bundle = { version = "0.0.0", path = "../macos-bundle" }

[dev-dependencies]
conformal_preferences = { version = "0.0.0", path = "../preferences", features = ["test-utils"] }
conformal_preferences = { version = "0.0.0", path = "../preferences", features = [
"test-utils"
] }
14 changes: 1 addition & 13 deletions rust/ui/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
#![warn(
nonstandard_style,
rust_2018_idioms,
future_incompatible,
clippy::pedantic,
clippy::todo
)]
#![allow(
clippy::type_complexity,
clippy::cast_sign_loss,
clippy::cast_possible_wrap,
clippy::default_trait_access
)]
#![allow(missing_docs)]
#![doc = include_str!("../docs_boilerplate.md")]
#![doc = include_str!("../README.md")]

Expand Down
2 changes: 1 addition & 1 deletion rust/ui/src/web_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl<S: super::ParameterStore + 'static> Ui<S> {
get_rsrc_response(&rsrc_root, &request).map(Into::into)
})
.with_devtools(dev_mode_enabled)
.with_url(&app_url(&web_dev_server))
.with_url(app_url(&web_dev_server))
.with_accept_first_mouse(true)
.with_back_forward_navigation_gestures(false)
.with_drag_drop_handler(|_| true)
Expand Down
7 changes: 5 additions & 2 deletions rust/vst-wrapper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
name = "conformal_vst_wrapper"
version = "0.0.0"
edition = "2021"
rust-version = "1.79.0"
rust-version.workspace = true
license = "ISC"
description = "Implements a VST3-compatible plug-in for audio processors implemented with the conformal audio plug-in framework."
repository = "https://github.com/russellmcc/conformal"
documentation = "https://russellmcc.github.io/conformal/rust-doc/conformal_vst_wrapper"
homepage = "https://russellmcc.github.io/conformal"

[lints]
workspace = true

[target.'cfg(target_os = "macos")'.dependencies]
conformal_macos_bundle = { version = "0.0.0", path = "../macos-bundle" }
conformal_macos_bundle = { version = "0.0.0", path = "../macos-bundle" }

[dependencies]
vst3 = "0.1.2"
Expand Down
4 changes: 2 additions & 2 deletions rust/vst-wrapper/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl<'a> StreamWrite<'a> {
}
}

impl<'a> std::io::Write for StreamWrite<'a> {
impl std::io::Write for StreamWrite<'_> {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
unsafe {
let mut num_written = 0;
Expand Down Expand Up @@ -49,7 +49,7 @@ impl<'a> StreamRead<'a> {
}
}

impl<'a> std::io::Read for StreamRead<'a> {
impl std::io::Read for StreamRead<'_> {
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
unsafe {
let mut num_read = 0;
Expand Down
16 changes: 0 additions & 16 deletions rust/vst-wrapper/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
#![warn(
nonstandard_style,
rust_2018_idioms,
future_incompatible,
missing_docs,
rustdoc::private_doc_tests,
rustdoc::unescaped_backticks,
clippy::pedantic,
clippy::todo
)]
#![allow(
clippy::type_complexity,
clippy::cast_sign_loss,
clippy::cast_possible_wrap,
clippy::default_trait_access
)]
#![doc = include_str!("../docs_boilerplate.md")]
#![doc = include_str!("../README.md")]

Expand Down
Loading

0 comments on commit f6f219e

Please sign in to comment.