Skip to content

Commit 26e6117

Browse files
committed
0.21.0: fix backwards compatible cargo +stable clippy -p c2rust warnings
1 parent 6e0e141 commit 26e6117

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

c2rust-ast-builder/src/builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,14 @@ impl<L: Make<Ident>> Make<Label> for L {
212212
}
213213
}
214214

215-
impl<'a> Make<Path> for &'a str {
215+
impl Make<Path> for &str {
216216
fn make(self, mk: &Builder) -> Path {
217217
let v = vec![self];
218218
Make::<Path>::make(v, mk)
219219
}
220220
}
221221

222-
impl<'a> Make<Abi> for &'a str {
222+
impl Make<Abi> for &str {
223223
fn make(self, mk: &Builder) -> Abi {
224224
Abi {
225225
extern_token: Token![extern](mk.span),
@@ -229,7 +229,7 @@ impl<'a> Make<Abi> for &'a str {
229229
}
230230
}
231231

232-
impl<'a> Make<Extern> for &'a str {
232+
impl Make<Extern> for &str {
233233
fn make(self, _mk: &Builder) -> Extern {
234234
Extern::Explicit(self.to_owned())
235235
}

c2rust-transpile/src/c_ast/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,11 @@ impl TypedAstContext {
299299
}
300300
}
301301

302-
pub fn iter_decls(&self) -> indexmap::map::Iter<CDeclId, CDecl> {
302+
pub fn iter_decls(&self) -> indexmap::map::Iter<'_, CDeclId, CDecl> {
303303
self.c_decls.iter()
304304
}
305305

306-
pub fn iter_mut_decls(&mut self) -> indexmap::map::IterMut<CDeclId, CDecl> {
306+
pub fn iter_mut_decls(&mut self) -> indexmap::map::IterMut<'_, CDeclId, CDecl> {
307307
self.c_decls.iter_mut()
308308
}
309309

c2rust-transpile/src/translator/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ pub fn translate(
519519
None,
520520
}
521521

522-
fn some_type_name(s: Option<&str>) -> Name {
522+
fn some_type_name(s: Option<&str>) -> Name<'_> {
523523
match s {
524524
None => Name::Anonymous,
525525
Some(r) => Name::Type(r),
@@ -5152,9 +5152,7 @@ impl<'c> Translation<'c> {
51525152
// If the definition lives in the same header, there is no need to import it
51535153
// in fact, this would be a hard rust error.
51545154
// We should never import into the main module here, as that happens in make_submodule
5155-
if import_file_id.map_or(false, |path| path == decl_file_id)
5156-
|| decl_file_id == self.main_file
5157-
{
5155+
if import_file_id == Some(decl_file_id) || decl_file_id == self.main_file {
51585156
return;
51595157
}
51605158

0 commit comments

Comments
 (0)