Skip to content

Commit f2e83bf

Browse files
committed
Add a note about async fn in traits
1 parent 5b03c5d commit f2e83bf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/context/base.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ pub trait BaseAudioContext {
100100
/// # Errors
101101
///
102102
/// This method returns an Error in various cases (IO, mime sniffing, decoding).
103+
// Use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified,
104+
// hence we use `-> impl Future + ..` instead.
103105
fn decode_audio_data<R: std::io::Read + Send + Sync + 'static>(
104106
&self,
105107
input: R,

0 commit comments

Comments
 (0)