1
Fork 0

Fix clippy::needless_borrow in the compiler

`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`.

Then I had to remove a few unnecessary parens and muts that were exposed
now.
This commit is contained in:
Nilstrieb 2023-11-21 20:07:32 +01:00
parent 0ff8610964
commit 21a870515b
304 changed files with 1101 additions and 1174 deletions

View file

@ -93,7 +93,7 @@ pub fn pretty_rvalue(rval: &Rvalue) -> String {
match rval {
Rvalue::AddressOf(muta, addr) => {
pretty.push_str("&raw ");
pretty.push_str(&ret_mutability(&muta));
pretty.push_str(&ret_mutability(muta));
pretty.push_str(format!("(*_{})", addr.local).as_str());
}
Rvalue::Aggregate(aggregatekind, operands) => {
@ -155,7 +155,7 @@ pub fn pretty_rvalue(rval: &Rvalue) -> String {
}
Rvalue::NullaryOp(nul, ty) => {
pretty.push_str(format!("{:#?}", nul).as_str());
pretty.push_str(&&pretty_ty(ty.kind()));
pretty.push_str(&pretty_ty(ty.kind()));
pretty.push_str(" ");
}
Rvalue::UnaryOp(un, op) => {

View file

@ -224,7 +224,7 @@ pub trait MirVisitor {
fn super_terminator(&mut self, term: &Terminator, location: Location) {
let Terminator { kind, span } = term;
self.visit_span(&span);
self.visit_span(span);
match kind {
TerminatorKind::Goto { .. }
| TerminatorKind::Resume

View file

@ -138,7 +138,7 @@ impl Span {
/// Return lines that corespond to this `Span`
pub fn get_lines(&self) -> LineInfo {
with(|c| c.get_lines(&self))
with(|c| c.get_lines(self))
}
}