Skip to content

Commit a6b574b

Browse files
committed
Cargo update and cargo clippy
1 parent a2f8617 commit a6b574b

File tree

7 files changed

+60
-53
lines changed

7 files changed

+60
-53
lines changed

Cargo.lock

Lines changed: 44 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ env_logger = "0.5"
4848
getopts = "0.2"
4949
derive-new = "0.5"
5050
cargo_metadata = "0.5"
51-
rustc-ap-syntax = "57.0.0"
52-
rustc-ap-rustc_errors = "57.0.0"
51+
rustc-ap-syntax = "60.0.0"
52+
rustc-ap-rustc_errors = "60.0.0"
5353

5454
[dev-dependencies]
5555
lazy_static = "1.0.0"

src/bin/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ fn execute(opts: &Options) -> FmtResult<Summary> {
335335
}
336336

337337
fn main() {
338-
let _ = env_logger::init();
338+
env_logger::init();
339339

340340
let opts = make_opts();
341341

src/expr.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,14 +1044,12 @@ impl<'a> ControlFlow<'a> {
10441044
.span_after(mk_sp(lo, self.span.hi()), self.keyword.trim()),
10451045
if self.pats.is_empty() {
10461046
cond_span.lo()
1047+
} else if self.matcher.is_empty() {
1048+
self.pats[0].span.lo()
10471049
} else {
1048-
if self.matcher.is_empty() {
1049-
self.pats[0].span.lo()
1050-
} else {
1051-
context
1052-
.snippet_provider
1053-
.span_before(self.span, self.matcher.trim())
1054-
}
1050+
context
1051+
.snippet_provider
1052+
.span_before(self.span, self.matcher.trim())
10551053
},
10561054
);
10571055

@@ -1268,7 +1266,7 @@ pub fn is_unsafe_block(block: &ast::Block) -> bool {
12681266
}
12691267
}
12701268

1271-
/// A simple wrapper type against ast::Arm. Used inside write_list().
1269+
/// A simple wrapper type against `ast::Arm`. Used inside `write_list()`.
12721270
struct ArmWrapper<'a> {
12731271
pub arm: &'a ast::Arm,
12741272
/// True if the arm is the last one in match expression. Used to decide on whether we should add
@@ -1787,7 +1785,7 @@ fn rewrite_multiple_patterns(
17871785
separator: " |",
17881786
trailing_separator: SeparatorTactic::Never,
17891787
separator_place: context.config.binop_separator(),
1790-
shape: shape,
1788+
shape,
17911789
ends_with_newline: false,
17921790
preserve_newline: false,
17931791
config: context.config,

src/format-diff/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl From<io::Error> for FormatDiffError {
8181
}
8282

8383
fn main() {
84-
let _ = env_logger::init();
84+
env_logger::init();
8585

8686
let mut opts = getopts::Options::new();
8787
opts.optflag("h", "help", "show this message");

src/git-rustfmt/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl Config {
184184
}
185185

186186
fn main() {
187-
let _ = env_logger::init();
187+
env_logger::init();
188188

189189
let opts = make_opts();
190190
let matches = opts.parse(env::args().skip(1))

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ pub fn get_modified_lines(
798798

799799
let mut config = config.clone();
800800
config.set().write_mode(config::WriteMode::Modified);
801-
let (summary, filemap, formatreport) = format_input(input, &config, Some(&mut data))?;
801+
let (summary, filemap, report) = format_input(input, &config, Some(&mut data))?;
802802

803803
let mut lines = data.lines();
804804
let mut chunks = Vec::new();
@@ -823,9 +823,9 @@ pub fn get_modified_lines(
823823
});
824824
}
825825
Ok(ModifiedLinesResult {
826-
summary: summary,
827-
filemap: filemap,
828-
report: formatreport,
826+
summary,
827+
filemap,
828+
report,
829829
modified_lines: ModifiedLines { chunks },
830830
})
831831
}

0 commit comments

Comments
 (0)