Skip to content

Commit

Permalink
⚰️ remove unused trait
Browse files Browse the repository at this point in the history
  • Loading branch information
Roms1383 committed Aug 31, 2024
1 parent 07f26c7 commit f02224a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 52 deletions.
21 changes: 1 addition & 20 deletions core/src/data/static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,7 @@ use kira::{
tween::Tween,
};

use crate::{AudioData, AudioDuration, SampleRate, With};

impl AudioData for StaticSoundData {
type Settings = StaticSoundSettings;

#[inline]
fn settings(&self) -> &Self::Settings {
&self.settings
}

#[inline]
fn slice(&self) -> Option<(usize, usize)> {
self.slice
}

#[inline]
fn with_slice(self, region: impl kira::sound::IntoOptionalRegion) -> Self {
self.slice(region)
}
}
use crate::{AudioDuration, SampleRate, With};

impl AudioDuration for StaticSoundData {
fn slice_duration(&self) -> std::time::Duration {
Expand Down
24 changes: 1 addition & 23 deletions core/src/data/streaming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,7 @@ use kira::{
tween::Tween,
};

use crate::{AudioData, AudioDuration, With};

impl<T> AudioData for StreamingSoundData<T>
where
T: Send + 'static,
{
type Settings = StreamingSoundSettings;

#[inline]
fn settings(&self) -> &Self::Settings {
&self.settings
}

#[inline]
fn slice(&self) -> Option<(usize, usize)> {
self.slice
}

#[inline]
fn with_slice(self, region: impl kira::sound::IntoOptionalRegion) -> Self {
self.slice(region)
}
}
use crate::{AudioDuration, With};

impl<T> AudioDuration for StreamingSoundData<T>
where
Expand Down
9 changes: 0 additions & 9 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ pub trait With<T> {
Self: Sized;
}

/// Audio data.
pub trait AudioData {
/// Associated settings.
type Settings: AudioSettings;
fn settings(&self) -> &Self::Settings;
fn slice(&self) -> Option<(usize, usize)>;
fn with_slice(self, region: impl IntoOptionalRegion) -> Self;
}

pub trait AudioDuration {
/// Current audio duration, based on its slice.
///
Expand Down

0 comments on commit f02224a

Please sign in to comment.