Skip to content

Commit 4c99362

Browse files
committed
clippy --fix.
1 parent d05b225 commit 4c99362

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

c2rust-ast-builder/src/builder.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,13 @@ impl Make<Ident> for &str {
178178

179179
impl Make<Ident> for String {
180180
fn make(self, mk: &Builder) -> Ident {
181-
Ident::new(&*self, mk.span)
181+
Ident::new(&self, mk.span)
182182
}
183183
}
184184

185185
impl Make<Ident> for &String {
186186
fn make(self, mk: &Builder) -> Ident {
187-
Ident::new(&*self, mk.span)
187+
Ident::new(self, mk.span)
188188
}
189189
}
190190

@@ -209,7 +209,8 @@ impl<'a> Make<Path> for &'a str {
209209

210210
impl<'a> Make<Visibility> for &'a str {
211211
fn make(self, mk_: &Builder) -> Visibility {
212-
let kind = match self {
212+
213+
match self {
213214
"pub" => Visibility::Public(VisPublic {
214215
pub_token: token::Pub(mk_.span),
215216
}),
@@ -230,8 +231,7 @@ impl<'a> Make<Visibility> for &'a str {
230231
path: Box::new(mk().path("super")),
231232
}),
232233
_ => panic!("unrecognized string for Visibility: {:?}", self),
233-
};
234-
kind
234+
}
235235
}
236236
}
237237

@@ -379,13 +379,13 @@ impl Make<NestedMeta> for Lit {
379379

380380
impl Make<Lit> for String {
381381
fn make(self, mk: &Builder) -> Lit {
382-
Lit::Str(LitStr::new(&*self, mk.span))
382+
Lit::Str(LitStr::new(&self, mk.span))
383383
}
384384
}
385385

386386
impl Make<Lit> for &String {
387387
fn make(self, mk: &Builder) -> Lit {
388-
Lit::Str(LitStr::new(&*self, mk.span))
388+
Lit::Str(LitStr::new(self, mk.span))
389389
}
390390
}
391391

@@ -884,7 +884,7 @@ impl Builder {
884884
let rhs = rhs.make(&self);
885885

886886
match op {
887-
BinOp::Lt(_) | BinOp::Shl(_) if has_rightmost_cast(&*lhs) => lhs = mk().paren_expr(lhs),
887+
BinOp::Lt(_) | BinOp::Shl(_) if has_rightmost_cast(&lhs) => lhs = mk().paren_expr(lhs),
888888
_ => {}
889889
}
890890

@@ -2596,13 +2596,13 @@ fn has_rightmost_cast(expr: &Expr) -> bool {
25962596
attrs: _,
25972597
op: _,
25982598
ref expr,
2599-
}) => has_rightmost_cast(&**expr),
2599+
}) => has_rightmost_cast(expr),
26002600
Expr::Binary(ExprBinary {
26012601
attrs: _,
26022602
left: _,
26032603
op: _,
26042604
ref right,
2605-
}) => has_rightmost_cast(&**right),
2605+
}) => has_rightmost_cast(right),
26062606
_ => false,
26072607
}
26082608
}

dynamic_instrumentation/src/instrument_memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ fn cast_ptr_to_usize<'tcx>(
10681068
let mut projs = Vec::with_capacity(deref.projection.len() + 1);
10691069
projs.extend(deref.projection);
10701070
projs.push(ProjectionElem::Deref);
1071-
deref.projection = tcx.intern_place_elems(&*projs);
1071+
deref.projection = tcx.intern_place_elems(&projs);
10721072
let cast_stmt = Statement {
10731073
source_info: SourceInfo::outermost(DUMMY_SP),
10741074
kind: StatementKind::Assign(Box::new((

0 commit comments

Comments
 (0)