Rename ast::StmtKind::Local
into ast::StmtKind::Let
This commit is contained in:
parent
5f8d353fe1
commit
fe0415e17a
@ -26,7 +26,7 @@ pub(crate) fn get_attrs_from_stmt(stmt: &ast::Stmt) -> &[ast::Attribute] {
|
|||||||
|
|
||||||
pub(crate) fn get_span_without_attrs(stmt: &ast::Stmt) -> Span {
|
pub(crate) fn get_span_without_attrs(stmt: &ast::Stmt) -> Span {
|
||||||
match stmt.kind {
|
match stmt.kind {
|
||||||
ast::StmtKind::Local(ref local) => local.span,
|
ast::StmtKind::Let(ref local) => local.span,
|
||||||
ast::StmtKind::Item(ref item) => item.span,
|
ast::StmtKind::Item(ref item) => item.span,
|
||||||
ast::StmtKind::Expr(ref expr) | ast::StmtKind::Semi(ref expr) => expr.span,
|
ast::StmtKind::Expr(ref expr) | ast::StmtKind::Semi(ref expr) => expr.span,
|
||||||
ast::StmtKind::MacCall(ref mac_stmt) => mac_stmt.mac.span(),
|
ast::StmtKind::MacCall(ref mac_stmt) => mac_stmt.mac.span(),
|
||||||
|
@ -61,7 +61,7 @@ fn span(&self) -> Span {
|
|||||||
impl Spanned for ast::Stmt {
|
impl Spanned for ast::Stmt {
|
||||||
fn span(&self) -> Span {
|
fn span(&self) -> Span {
|
||||||
match self.kind {
|
match self.kind {
|
||||||
ast::StmtKind::Local(ref local) => mk_sp(local.span().lo(), self.span.hi()),
|
ast::StmtKind::Let(ref local) => mk_sp(local.span().lo(), self.span.hi()),
|
||||||
ast::StmtKind::Item(ref item) => mk_sp(item.span().lo(), self.span.hi()),
|
ast::StmtKind::Item(ref item) => mk_sp(item.span().lo(), self.span.hi()),
|
||||||
ast::StmtKind::Expr(ref expr) | ast::StmtKind::Semi(ref expr) => {
|
ast::StmtKind::Expr(ref expr) | ast::StmtKind::Semi(ref expr) => {
|
||||||
mk_sp(expr.span().lo(), self.span.hi())
|
mk_sp(expr.span().lo(), self.span.hi())
|
||||||
|
@ -115,7 +115,7 @@ fn format_stmt(
|
|||||||
skip_out_of_file_lines_range!(context, stmt.span());
|
skip_out_of_file_lines_range!(context, stmt.span());
|
||||||
|
|
||||||
let result = match stmt.kind {
|
let result = match stmt.kind {
|
||||||
ast::StmtKind::Local(ref local) => local.rewrite(context, shape),
|
ast::StmtKind::Let(ref local) => local.rewrite(context, shape),
|
||||||
ast::StmtKind::Expr(ref ex) | ast::StmtKind::Semi(ref ex) => {
|
ast::StmtKind::Expr(ref ex) | ast::StmtKind::Semi(ref ex) => {
|
||||||
let suffix = if semicolon_for_stmt(context, stmt, is_last_expr) {
|
let suffix = if semicolon_for_stmt(context, stmt, is_last_expr) {
|
||||||
";"
|
";"
|
||||||
|
@ -150,7 +150,7 @@ fn visit_stmt(&mut self, stmt: &Stmt<'_>, include_empty_semi: bool) {
|
|||||||
self.visit_item(item);
|
self.visit_item(item);
|
||||||
self.last_pos = stmt.span().hi();
|
self.last_pos = stmt.span().hi();
|
||||||
}
|
}
|
||||||
ast::StmtKind::Local(..) | ast::StmtKind::Expr(..) | ast::StmtKind::Semi(..) => {
|
ast::StmtKind::Let(..) | ast::StmtKind::Expr(..) | ast::StmtKind::Semi(..) => {
|
||||||
let attrs = get_attrs_from_stmt(stmt.as_ast_node());
|
let attrs = get_attrs_from_stmt(stmt.as_ast_node());
|
||||||
if contains_skip(attrs) {
|
if contains_skip(attrs) {
|
||||||
self.push_skipped_with_span(
|
self.push_skipped_with_span(
|
||||||
|
Loading…
Reference in New Issue
Block a user