delegation: Implement list delegation

```rust
reuse prefix::{a, b, c}
```
This commit is contained in:
Vadim Petrochenkov 2024-03-15 14:21:03 +03:00
parent 2c7016776d
commit 05a2db7624
2 changed files with 3 additions and 3 deletions

View File

@ -739,8 +739,8 @@ fn visit_impl_items(&mut self, items: &[ptr::P<ast::AssocItem>]) {
(_, Const(..)) => Ordering::Greater, (_, Const(..)) => Ordering::Greater,
(MacCall(..), _) => Ordering::Less, (MacCall(..), _) => Ordering::Less,
(_, MacCall(..)) => Ordering::Greater, (_, MacCall(..)) => Ordering::Greater,
(Delegation(..), _) => Ordering::Less, (Delegation(..), _) | (DelegationMac(..), _) => Ordering::Less,
(_, Delegation(..)) => Ordering::Greater, (_, Delegation(..)) | (_, DelegationMac(..)) => Ordering::Greater,
}); });
let mut prev_kind = None; let mut prev_kind = None;
for (buf, item) in buffer { for (buf, item) in buffer {

View File

@ -586,7 +586,7 @@ pub(crate) fn visit_item(&mut self, item: &ast::Item) {
); );
self.push_rewrite(item.span, rewrite); self.push_rewrite(item.span, rewrite);
} }
ast::ItemKind::Delegation(..) => { ast::ItemKind::Delegation(..) | ast::ItemKind::DelegationMac(..) => {
// TODO: rewrite delegation items once syntax is established. // TODO: rewrite delegation items once syntax is established.
// For now, leave the contents of the Span unformatted. // For now, leave the contents of the Span unformatted.
self.push_rewrite(item.span, None) self.push_rewrite(item.span, None)