We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents bc573b0 + 3d8b296 commit 7611518Copy full SHA for 7611518
webrtc/src/data_channel/mod.rs
@@ -376,12 +376,12 @@ impl RTCDataChannel {
376
}
377
378
/// send_text sends the text message to the DataChannel peer
379
- pub async fn send_text(&self, s: String) -> Result<usize> {
+ pub async fn send_text(&self, s: impl Into<String>) -> Result<usize> {
380
self.ensure_open()?;
381
382
let data_channel = self.data_channel.lock().await;
383
if let Some(dc) = &*data_channel {
384
- Ok(dc.write_data_channel(&Bytes::from(s), true).await?)
+ Ok(dc.write_data_channel(&Bytes::from(s.into()), true).await?)
385
} else {
386
Err(Error::ErrClosedPipe)
387
0 commit comments