From e8ce0659a7884b31f7c90f8be9c8f652da7b08d3 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 26 Jan 2019 16:41:36 -0500 Subject: [PATCH 1/4] take: fix doc comment --- src/source/take.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/source/take.rs b/src/source/take.rs index 58a2c12..ee4de22 100644 --- a/src/source/take.rs +++ b/src/source/take.rs @@ -3,7 +3,7 @@ use std::time::Duration; use Sample; use Source; -/// Internal function that builds a `Repeat` object. +/// Internal function that builds a `TakeDuration` object. pub fn take_duration(input: I, duration: Duration) -> TakeDuration where I: Source, From 404e77351b8b07b7eb18c596165216a869b42c3e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 26 Jan 2019 16:42:15 -0500 Subject: [PATCH 2/4] fadein: fix documentation --- src/source/fadein.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/source/fadein.rs b/src/source/fadein.rs index e018d14..520f539 100644 --- a/src/source/fadein.rs +++ b/src/source/fadein.rs @@ -18,7 +18,7 @@ where } } -/// Filter that modifies each sample by a given value. +/// Filter that modifies raises the volume from silence over a time period. #[derive(Clone, Debug)] pub struct FadeIn where From b5d678a44b7249f8a7459fd9e65cf9120cac9666 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 26 Jan 2019 16:48:28 -0500 Subject: [PATCH 3/4] done: fix markup on doc comment --- src/source/done.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/source/done.rs b/src/source/done.rs index 5fb273e..12fab44 100644 --- a/src/source/done.rs +++ b/src/source/done.rs @@ -4,7 +4,7 @@ use std::time::Duration; use Sample; use Source; -/// When the inner source is empty this decrements an AtomicUsize +/// When the inner source is empty this decrements an `AtomicUsize`. #[derive(Debug, Clone)] pub struct Done where From e61d14ba389d554ef2e57ed873b9fa572950d343 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 26 Jan 2019 16:41:11 -0500 Subject: [PATCH 4/4] sources: remove excess constraints on structures --- src/source/delay.rs | 6 +----- src/source/done.rs | 12 ++---------- src/source/fadein.rs | 6 +----- src/source/samples_converter.rs | 14 ++------------ src/source/speed.rs | 12 ++---------- src/source/take.rs | 12 ++---------- 6 files changed, 10 insertions(+), 52 deletions(-) diff --git a/src/source/delay.rs b/src/source/delay.rs index 0b35d84..a408a29 100644 --- a/src/source/delay.rs +++ b/src/source/delay.rs @@ -21,11 +21,7 @@ where /// A source that delays the given source by a certain amount. #[derive(Clone, Debug)] -pub struct Delay -where - I: Source, - I::Item: Sample, -{ +pub struct Delay { input: I, remaining_samples: usize, requested_duration: Duration, diff --git a/src/source/done.rs b/src/source/done.rs index 12fab44..a2e86a8 100644 --- a/src/source/done.rs +++ b/src/source/done.rs @@ -6,21 +6,13 @@ use Source; /// When the inner source is empty this decrements an `AtomicUsize`. #[derive(Debug, Clone)] -pub struct Done -where - I: Source, - I::Item: Sample, -{ +pub struct Done { input: I, signal: Arc, signal_sent: bool, } -impl Done -where - I: Source, - I::Item: Sample, -{ +impl Done { #[inline] pub fn new(input: I, signal: Arc) -> Done { Done { diff --git a/src/source/fadein.rs b/src/source/fadein.rs index 520f539..f2eb2c2 100644 --- a/src/source/fadein.rs +++ b/src/source/fadein.rs @@ -20,11 +20,7 @@ where /// Filter that modifies raises the volume from silence over a time period. #[derive(Clone, Debug)] -pub struct FadeIn -where - I: Source, - I::Item: Sample, -{ +pub struct FadeIn { input: I, remaining_ns: f32, total_ns: f32, diff --git a/src/source/samples_converter.rs b/src/source/samples_converter.rs index 3ad3471..f3d65ac 100644 --- a/src/source/samples_converter.rs +++ b/src/source/samples_converter.rs @@ -11,22 +11,12 @@ use Source; /// It implements `Source` as well, but all the data is guaranteed to be in a single frame whose /// channels and samples rate have been passed to `new`. #[derive(Clone)] -pub struct SamplesConverter -where - I: Source, - I::Item: Sample, - D: Sample, -{ +pub struct SamplesConverter { inner: I, dest: PhantomData, } -impl SamplesConverter -where - I: Source, - I::Item: Sample, - D: Sample, -{ +impl SamplesConverter { #[inline] pub fn new(input: I) -> SamplesConverter { SamplesConverter { diff --git a/src/source/speed.rs b/src/source/speed.rs index adf3b87..2236677 100644 --- a/src/source/speed.rs +++ b/src/source/speed.rs @@ -4,11 +4,7 @@ use Sample; use Source; /// Internal function that builds a `Speed` object. -pub fn speed(input: I, factor: f32) -> Speed -where - I: Source, - I::Item: Sample, -{ +pub fn speed(input: I, factor: f32) -> Speed { Speed { input: input, factor: factor, @@ -17,11 +13,7 @@ where /// Filter that modifies each sample by a given value. #[derive(Clone, Debug)] -pub struct Speed -where - I: Source, - I::Item: Sample, -{ +pub struct Speed { input: I, factor: f32, } diff --git a/src/source/take.rs b/src/source/take.rs index ee4de22..97eaaf0 100644 --- a/src/source/take.rs +++ b/src/source/take.rs @@ -4,11 +4,7 @@ use Sample; use Source; /// Internal function that builds a `TakeDuration` object. -pub fn take_duration(input: I, duration: Duration) -> TakeDuration -where - I: Source, - I::Item: Sample, -{ +pub fn take_duration(input: I, duration: Duration) -> TakeDuration { TakeDuration { input: input, remaining_duration: duration, @@ -18,11 +14,7 @@ where /// A source that repeats the given source. #[derive(Clone, Debug)] -pub struct TakeDuration -where - I: Source, - I::Item: Sample, -{ +pub struct TakeDuration { input: I, remaining_duration: Duration, requested_duration: Duration,