Skip to content

Commit

Permalink
delegation: Implement list delegation
Browse files Browse the repository at this point in the history
```rust
reuse prefix::{a, b, c}
```
  • Loading branch information
petrochenkov committed May 14, 2024
1 parent 2c70167 commit 05a2db7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,8 @@ impl<'a> FmtVisitor<'a> {
(_, Const(..)) => Ordering::Greater,
(MacCall(..), _) => Ordering::Less,
(_, MacCall(..)) => Ordering::Greater,
(Delegation(..), _) => Ordering::Less,
(_, Delegation(..)) => Ordering::Greater,
(Delegation(..), _) | (DelegationMac(..), _) => Ordering::Less,
(_, Delegation(..)) | (_, DelegationMac(..)) => Ordering::Greater,
});
let mut prev_kind = None;
for (buf, item) in buffer {
Expand Down
2 changes: 1 addition & 1 deletion src/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
);
self.push_rewrite(item.span, rewrite);
}
ast::ItemKind::Delegation(..) => {
ast::ItemKind::Delegation(..) | ast::ItemKind::DelegationMac(..) => {
// TODO: rewrite delegation items once syntax is established.
// For now, leave the contents of the Span unformatted.
self.push_rewrite(item.span, None)
Expand Down

0 comments on commit 05a2db7

Please sign in to comment.