mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 04:33:06 +00:00
fix autofmt
This commit is contained in:
parent
c9d00908ec
commit
6639011a3e
2 changed files with 6 additions and 9 deletions
|
@ -5,8 +5,6 @@
|
|||
use proc_macro2::LineColumn;
|
||||
use syn::{Block, Expr, File, Item, Macro, Stmt};
|
||||
|
||||
use crate::expr;
|
||||
|
||||
type CollectedMacro<'a> = &'a Macro;
|
||||
|
||||
pub fn collect_from_file<'a>(file: &'a File, macros: &mut Vec<CollectedMacro<'a>>) {
|
||||
|
@ -44,8 +42,7 @@ pub fn collect_from_item<'a>(item: &'a Item, macros: &mut Vec<CollectedMacro<'a>
|
|||
}
|
||||
|
||||
// None of these we can really do anything with at the item level
|
||||
Item::Macro(_)
|
||||
| Item::Enum(_)
|
||||
Item::Enum(_)
|
||||
| Item::ExternCrate(_)
|
||||
| Item::ForeignMod(_)
|
||||
| Item::TraitAlias(_)
|
||||
|
@ -156,7 +153,6 @@ pub fn collect_from_expr<'a>(expr: &'a Expr, macros: &mut Vec<CollectedMacro<'a>
|
|||
|
||||
// don't both formatting these for now
|
||||
Expr::Array(_)
|
||||
| Expr::Assign(_)
|
||||
| Expr::Await(_)
|
||||
| Expr::Binary(_)
|
||||
| Expr::Break(_)
|
||||
|
|
|
@ -88,10 +88,11 @@ pub fn fmt_file(contents: &str) -> Vec<FormattedBlock> {
|
|||
}
|
||||
|
||||
let span = match item.delimiter {
|
||||
MacroDelimiter::Paren(b) => b.span.open(),
|
||||
MacroDelimiter::Brace(b) => b.span.open(),
|
||||
MacroDelimiter::Bracket(b) => b.span.open(),
|
||||
};
|
||||
MacroDelimiter::Paren(b) => b.span,
|
||||
MacroDelimiter::Brace(b) => b.span,
|
||||
MacroDelimiter::Bracket(b) => b.span,
|
||||
}
|
||||
.join();
|
||||
|
||||
let mut formatted = String::new();
|
||||
|
||||
|
|
Loading…
Reference in a new issue