From d74c46bc06f6533b3682275c4131af069c5c5489 Mon Sep 17 00:00:00 2001 From: timofey Date: Mon, 25 Sep 2023 01:18:52 +0000 Subject: [PATCH] `FromRef` docs --- src/mode/stream.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mode/stream.rs b/src/mode/stream.rs index fff0f17..7b6e876 100644 --- a/src/mode/stream.rs +++ b/src/mode/stream.rs @@ -71,7 +71,11 @@ impl StreamResultExt for Result<(A, I), E> { } } +/// [`From`] for references (of any lifetime). pub trait FromRef: for<'a> From<&'a T> { + /// [`From::from(&'a T)`] but without specific `'a`. + /// + /// [`From::from(&'a T)`]: From::from fn from_ref(value: &T) -> Self { Self::from(value) }