Clippy-fix explicit auto-deref

Seems like these can be safely fixed. With one, I was particularly
surprised -- `Some(pats) => &**pats,` in body.rs?

```
cargo clippy --fix -- -A clippy::all -D clippy::explicit_auto_deref
```
This commit is contained in:
Yuri Astrakhan 2022-12-23 02:51:52 -05:00
parent f1785f7a21
commit e341e996f7
20 changed files with 22 additions and 22 deletions

View file

@ -253,7 +253,7 @@ impl LsifManager<'_> {
};
let result = folds
.into_iter()
.map(|it| to_proto::folding_range(&*text, &line_index, false, it))
.map(|it| to_proto::folding_range(&text, &line_index, false, it))
.collect();
let folding_id = self.add_vertex(lsif::Vertex::FoldingRangeResult { result });
self.add_edge(lsif::Edge::FoldingRange(lsif::EdgeData {

View file

@ -2178,7 +2178,7 @@ fn manual(fields: &[(&'static str, &'static str, &[&str], &str)]) -> String {
.iter()
.map(|(field, _ty, doc, default)| {
let name = format!("rust-analyzer.{}", field.replace('_', "."));
let doc = doc_comment_to_string(*doc);
let doc = doc_comment_to_string(doc);
if default.contains('\n') {
format!(
r#"[[{}]]{}::

View file

@ -899,7 +899,7 @@ pub(crate) fn handle_folding_range(
let line_folding_only = snap.config.line_folding_only();
let res = folds
.into_iter()
.map(|it| to_proto::folding_range(&*text, &line_index, line_folding_only, it))
.map(|it| to_proto::folding_range(&text, &line_index, line_folding_only, it))
.collect();
Ok(Some(res))
}
@ -979,7 +979,7 @@ pub(crate) fn handle_rename(
let position = from_proto::file_position(&snap, params.text_document_position)?;
let mut change =
snap.analysis.rename(position, &*params.new_name)?.map_err(to_proto::rename_error)?;
snap.analysis.rename(position, &params.new_name)?.map_err(to_proto::rename_error)?;
// this is kind of a hack to prevent double edits from happening when moving files
// When a module gets renamed by renaming the mod declaration this causes the file to move