fix clippy warnings

This commit is contained in:
zimbatm 2021-04-11 14:32:42 +02:00
parent 63c58e4f55
commit 4edd9dc581
No known key found for this signature in database
GPG Key ID: 71BAF6D40C1D63D7
2 changed files with 2 additions and 2 deletions

View File

@ -380,7 +380,7 @@ pub fn run_treefmt_stdin(
formatters
.first()
.unwrap()
.fmt(&vec![tmpfile.path().to_path_buf()])?;
.fmt(&[tmpfile.path().to_path_buf()])?;
// Seek back to start
let mut tmpfile = tmpfile.reopen()?;

View File

@ -107,7 +107,7 @@ impl CacheManifest {
/// Checks and inserts the formatter info into the cache.
/// If the formatter info has changed, invalidate all the old paths.
pub fn update_formatters(&mut self, formatters: BTreeMap<FormatterName, Formatter>) {
let mut old_formatters = std::mem::replace(&mut self.formatters, BTreeMap::new());
let mut old_formatters = std::mem::take(&mut self.formatters);
for (name, fmt) in formatters {
match load_formatter_info(fmt) {
Ok(new_fmt_info) => {