Skip to content

Commit

Permalink
Update zerocopy to 0.8.13
Browse files Browse the repository at this point in the history
Signed-off-by: yubiuser <[email protected]>
  • Loading branch information
yubiuser committed Dec 14, 2024
1 parent 71d422b commit dd1cd36
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 17 deletions.
38 changes: 29 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ serde_json = "1.0"
sha1 = "0.10"
thiserror = "2.0"
tokio = { version = "1", features = ["parking_lot", "sync", "rt"] }
zbus = { version = "4", default-features = false, features = ["tokio"], optional = true }
zbus = { version = "4", default-features = false, features = ["tokio"], optional = true } # zbus > 4 requires a MSRV of 1.80

[dependencies.librespot-core]
path = "../core"
Expand Down
2 changes: 1 addition & 1 deletion playback/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ parking_lot = { version = "0.12", features = ["deadlock_detection"] }
shell-words = "1.1"
thiserror = "2.0"
tokio = { version = "1", features = ["parking_lot", "rt", "rt-multi-thread", "sync"] }
zerocopy = { version = "0.7.32", features = ["derive"] }
zerocopy = { version = "0.8.13", features = ["derive"] }

# Backends
alsa = { version = "0.9.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion playback/src/audio_backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ macro_rules! sink_as_bytes {
() => {
fn write(&mut self, packet: AudioPacket, converter: &mut Converter) -> SinkResult<()> {
use crate::convert::i24;
use zerocopy::AsBytes;
use zerocopy::IntoBytes;
match packet {
AudioPacket::Samples(samples) => match self.format {
AudioFormat::F64 => self.write_bytes(samples.as_bytes()),
Expand Down
4 changes: 2 additions & 2 deletions playback/src/convert.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::dither::{Ditherer, DithererBuilder};
use zerocopy::AsBytes;
use zerocopy::{Immutable, IntoBytes};

#[derive(AsBytes, Copy, Clone, Debug)]
#[derive(Immutable, IntoBytes, Copy, Clone, Debug)]
#[allow(non_camel_case_types)]
#[repr(transparent)]
pub struct i24([u8; 3]);
Expand Down
14 changes: 11 additions & 3 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

set -e

clean() {
# some shells will call EXIT after the INT signal
# causing EXIT trap to be executed, so we trap EXIT after INT
trap '' EXIT

cargo clean
}

trap clean INT QUIT TERM EXIT

# this script runs the tests and checks that also run as part of the`test.yml` github action workflow
cargo clean
cargo fmt --all -- --check
Expand All @@ -18,6 +28,4 @@ cargo check -p librespot-core --no-default-features
cargo check -p librespot-core
cargo hack check --no-dev-deps --each-feature -p librespot-discovery
cargo hack check --no-dev-deps --each-feature -p librespot-playback
cargo hack check --no-dev-deps --each-feature

cargo clean
cargo hack check --no-dev-deps --each-feature

0 comments on commit dd1cd36

Please sign in to comment.