Finish implementing is_multiline for Spaced

This commit is contained in:
Richard Feldman 2022-02-01 21:18:54 -05:00
parent 3b1ca5c310
commit 271112fec1
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798

View file

@ -222,8 +222,14 @@ fn fmt_package_name<'buf>(buf: &mut Buf<'buf>, name: PackageName, _indent: u16)
impl<'a, T: Formattable> Formattable for Spaced<'a, T> {
fn is_multiline(&self) -> bool {
// TODO
false
use Spaced::*;
match self {
Item(formattable) => formattable.is_multiline(),
SpaceBefore(formattable, spaces) | SpaceAfter(formattable, spaces) => {
!spaces.is_empty() || formattable.is_multiline()
}
}
}
fn format_with_options<'buf>(