Remove unused AsFormat trait for Option<T> (#3041)

We should re-add this, but it's currently unused and doesn't compile under 1.66.0.

See: #3039.
This commit is contained in:
Charlie Marsh 2023-02-19 15:19:35 -05:00 committed by GitHub
parent d6a100028c
commit c297d46899
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,21 +22,6 @@ where
}
}
/// Implement [`AsFormat`] for [`Option`] when `T` implements [`AsFormat`]
///
/// Allows to call format on optional AST fields without having to unwrap the
/// field first.
impl<T, C> AsFormat<C> for Option<T>
where
T: AsFormat<C>,
{
type Format<'a> = Option<T::Format<'a>> where Self: 'a;
fn format(&self) -> Self::Format<'_> {
self.as_ref().map(AsFormat::format)
}
}
/// Used to convert this object into an object that can be formatted.
///
/// The difference to [`AsFormat`] is that this trait takes ownership of `self`.