From d18a82aa4bcc606e449de7185c93acad8d65d89d Mon Sep 17 00:00:00 2001 From: stephanwilliams Date: Sun, 1 Oct 2017 05:20:57 -0400 Subject: [PATCH] Make mixer::Channel and mixer::Group fields public (#708) Also deprecate the now-unnecessary mixer::channel(i32) function. --- changelog.md | 5 +++++ src/sdl2/mixer/mod.rs | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index ee2a40a91e4..b6e23c82a28 100644 --- a/changelog.md +++ b/changelog.md @@ -23,6 +23,11 @@ in `Texture`s in the `render` module. * Adds the `Music::from_static_bytes` function, which creates a Music instance with the static lifetime from a buffer that also has a static lifetime. +[PR #708](https://github.com/Rust-SDL2/rust-sdl2/pull/708) + +* Makes the fields of the `sdl2::mixer::Channel(i32)` and `sdl::mixer::Group(i32)` structs +public so they can be instantiated directly, and deprecates `sdl2::mixer::channel(i32)`. + ### v0.30 Re-exported sdl2\_sys as sdl2::sys diff --git a/src/sdl2/mixer/mod.rs b/src/sdl2/mixer/mod.rs index 481dee09e2b..c84dbcd4640 100644 --- a/src/sdl2/mixer/mod.rs +++ b/src/sdl2/mixer/mod.rs @@ -336,9 +336,10 @@ pub enum Fading { /// Sound effect channel. #[derive(Debug, Copy, Clone, PartialEq)] -pub struct Channel(i32); +pub struct Channel(pub i32); /// Return a channel object. +#[deprecated(since = "0.31.0", note = "use `Channel(i32)` instead")] pub fn channel(chan: i32) -> Channel { Channel(chan) } @@ -629,7 +630,7 @@ pub fn reserve_channels(num: i32) -> i32 { /// Sound effect channel grouping. #[derive(Copy, Clone)] -pub struct Group(i32); +pub struct Group(pub i32); impl default::Default for Group { fn default() -> Group {