Skip to content

Commit cbcf1fe

Browse files
committed
Misc. improvements to Compat
1 parent d1020da commit cbcf1fe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

futures-util/src/compat/compat03as01.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::{marker::{PhantomData, Unpin}, ops::Deref, pin::Pin, ptr::NonNull, sync
1515
/// [`Future`](futures::future::Future),
1616
/// [`Stream`](futures::stream::Stream) or
1717
/// [`Sink`](futures::sink::Sink).
18-
#[derive(Debug)]
18+
#[derive(Debug, Clone, Copy)]
1919
#[must_use = "futures do nothing unless polled"]
2020
pub struct Compat<T> {
2121
pub(crate) inner: T,
@@ -28,7 +28,11 @@ impl<T> Compat<T> {
2828
}
2929

3030
/// Creates a new [`Compat`].
31-
pub(crate) fn new(inner: T) -> Compat<T> {
31+
///
32+
/// For types which implement appropriate futures `0.3`
33+
/// traits, the result will be a type which implements
34+
/// the corresponding futures 0.1 type.
35+
pub fn new(inner: T) -> Compat<T> {
3236
Compat { inner }
3337
}
3438
}

0 commit comments

Comments
 (0)