Skip to content

Commit 70b82a0

Browse files
chore: resolve compiler warnings
1 parent ecbb064 commit 70b82a0

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/items.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::cmp::{max, min, Ordering};
66
use regex::Regex;
77
use rustc_ast::visit;
88
use rustc_ast::{ast, ptr};
9-
use rustc_span::{symbol::kw, symbol::Ident, BytePos, Span};
9+
use rustc_span::{symbol::kw, symbol::Ident, BytePos, Span, DUMMY_SP};
1010

1111
use crate::attr::filter_inline_attrs;
1212
use crate::comment::{
@@ -31,7 +31,12 @@ use crate::stmt::Stmt;
3131
use crate::utils::*;
3232
use crate::vertical::rewrite_with_alignment;
3333
use crate::visitor::FmtVisitor;
34-
use crate::DEFAULT_VISIBILITY;
34+
35+
const DEFAULT_VISIBILITY: ast::Visibility = ast::Visibility {
36+
kind: ast::VisibilityKind::Inherited,
37+
span: DUMMY_SP,
38+
tokens: None,
39+
};
3540

3641
fn type_annotation_separator(config: &Config) -> &str {
3742
colon_spaces(config)
@@ -987,7 +992,7 @@ impl<'a> StructParts<'a> {
987992
matches!(self.def, StructPartsVariantData::Tuple(..))
988993
}
989994

990-
pub(crate) fn from_variant(variant: &'a ast::Variant) -> Self {
995+
fn from_variant(variant: &'a ast::Variant) -> Self {
991996
StructParts {
992997
prefix: "",
993998
ident: variant.ident,

src/lib.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use std::rc::Rc;
3131

3232
use ignore;
3333
use rustc_ast::ast;
34-
use rustc_span::{symbol, DUMMY_SP};
34+
use rustc_span::symbol;
3535
use thiserror::Error;
3636

3737
use crate::comment::LineClasses;
@@ -95,11 +95,6 @@ mod types;
9595
mod vertical;
9696
pub(crate) mod visitor;
9797

98-
const DEFAULT_VISIBILITY: ast::Visibility = ast::Visibility {
99-
kind: ast::VisibilityKind::Inherited,
100-
span: DUMMY_SP,
101-
tokens: None,
102-
};
10398
/// The various errors that can occur during formatting. Note that not all of
10499
/// these can currently be propagated to clients.
105100
#[derive(Error, Debug)]

src/types.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::iter::ExactSizeIterator;
22
use std::ops::Deref;
33

44
use rustc_ast::ast::{self, FnRetTy, Mutability};
5-
use rustc_span::{symbol::kw, symbol::Ident, BytePos, Pos, Span};
5+
use rustc_span::{symbol::kw, BytePos, Pos, Span};
66

77
use crate::config::lists::*;
88
use crate::config::{IndentStyle, TypeDensity, Version};
@@ -24,7 +24,6 @@ use crate::utils::{
2424
colon_spaces, extra_offset, first_line_width, format_extern, format_mutability,
2525
last_line_extendable, last_line_width, mk_sp, rewrite_ident,
2626
};
27-
use crate::DEFAULT_VISIBILITY;
2827
use crate::{
2928
comment::{combine_strs_with_missing_comments, contains_comment},
3029
items::format_struct_struct,

0 commit comments

Comments
 (0)