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:
parent
0ff8610964
commit
21a870515b
304 changed files with 1101 additions and 1174 deletions
|
@ -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) => {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue