mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 13:33:50 +00:00
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:
parent
d6a100028c
commit
c297d46899
1 changed files with 0 additions and 15 deletions
|
@ -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`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue