Add documentation on skip_binder on how to get &T from &EarlyBinder<T>

This commit is contained in:
Kyle Matsuda 2023-05-26 14:10:58 -06:00
parent c40e9cc7ca
commit c29c212f8d

View File

@ -586,6 +586,9 @@ impl<T> EarlyBinder<T> {
/// arguments of an `FnSig`). Otherwise, consider using
/// [`subst_identity`](EarlyBinder::subst_identity).
///
/// To skip the binder on `x: &EarlyBinder<T>` to obtain `&T`, leverage
/// [`EarlyBinder::as_ref`](EarlyBinder::as_ref): `x.as_ref().skip_binder()`.
///
/// See also [`Binder::skip_binder`](super::Binder::skip_binder), which is
/// the analogous operation on [`super::Binder`].
pub fn skip_binder(self) -> T {