Skip to content

Commit 8e81ea8

Browse files
committed
Fix new clippy lints.
1 parent 0d23d86 commit 8e81ea8

File tree

8 files changed

+14
-15
lines changed

8 files changed

+14
-15
lines changed

Cargo.lock

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/src/ast_discoverer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct PerModDiscoveries<'a> {
7474
mod_path: Option<RustPath>,
7575
}
7676

77-
impl<'b> PerModDiscoveries<'b> {
77+
impl PerModDiscoveries<'_> {
7878
fn deeper_path(&self, id: &Ident) -> RustPath {
7979
match &self.mod_path {
8080
None => RustPath::new_from_ident(id.clone()),
@@ -517,7 +517,7 @@ impl<'a> SelfSubstituter<'a> {
517517
}
518518
}
519519

520-
impl<'a> VisitMut for SelfSubstituter<'a> {
520+
impl VisitMut for SelfSubstituter<'_> {
521521
fn visit_type_path_mut(&mut self, i: &mut syn::TypePath) {
522522
if i.qself.is_none() && i.path.is_ident("Self") {
523523
i.path = Path::from(self.self_ty.clone());

engine/src/conversion/analysis/fun/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ impl<'a> FnAnalyzer<'a> {
12641264
let param_conversion_needed = param_details.iter().any(|b| b.conversion.cpp_work_needed());
12651265
let ret_type_conversion_needed = ret_type_conversion
12661266
.as_ref()
1267-
.map_or(false, |x| x.cpp_work_needed());
1267+
.is_some_and(|x| x.cpp_work_needed());
12681268
let return_needs_rust_conversion = ret_type_conversion
12691269
.as_ref()
12701270
.map(|ra| ra.rust_work_needed())

engine/src/conversion/codegen_rs/unqualify.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ use syn::{
1111
ReturnType, Token, Type, TypePath,
1212
};
1313

14-
/// Mod to handle stripping paths off the front of types.
15-
1614
fn unqualify_type_path(typ: TypePath) -> TypePath {
1715
// If we've still got more than one
1816
// path segment then this is referring to a type within

gen/cmd/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ struct FileWriter<'a> {
407407
written: IndexSet<String>,
408408
}
409409

410-
impl<'a> FileWriter<'a> {
410+
impl FileWriter<'_> {
411411
fn write_placeholders<F: FnOnce(usize) -> String + Copy>(
412412
&mut self,
413413
mut counter: usize,

integration-tests/tests/code_checkers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl<'a> CppMatcher<'a> {
138138
}
139139
}
140140

141-
impl<'a> CodeCheckerFns for CppMatcher<'a> {
141+
impl CodeCheckerFns for CppMatcher<'_> {
142142
fn check_cpp(&self, cpp: &[PathBuf]) -> Result<(), TestError> {
143143
let mut positives_needed = self.positive_matches.to_vec();
144144
for filename in cpp {

src/reference_wrapper.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<'a, T: ?Sized> CppRef<'a, T> {
192192
}
193193
}
194194

195-
impl<'a, T: ?Sized> Deref for CppRef<'a, T> {
195+
impl<T: ?Sized> Deref for CppRef<'_, T> {
196196
type Target = *const T;
197197
#[inline]
198198
fn deref(&self) -> &Self::Target {
@@ -208,7 +208,7 @@ impl<'a, T: ?Sized> Deref for CppRef<'a, T> {
208208
}
209209
}
210210

211-
impl<'a, T: ?Sized> Clone for CppRef<'a, T> {
211+
impl<T: ?Sized> Clone for CppRef<'_, T> {
212212
fn clone(&self) -> Self {
213213
Self {
214214
ptr: self.ptr,
@@ -233,7 +233,7 @@ pub struct CppMutRef<'a, T: ?Sized> {
233233
phantom: PhantomData<&'a T>,
234234
}
235235

236-
impl<'a, T: ?Sized> CppMutRef<'a, T> {
236+
impl<T: ?Sized> CppMutRef<'_, T> {
237237
/// Retrieve the underlying C++ pointer.
238238
pub fn as_mut_ptr(&self) -> *mut T {
239239
self.ptr
@@ -269,7 +269,7 @@ impl<'a, T: ?Sized> CppMutRef<'a, T> {
269269
}
270270
}
271271

272-
impl<'a, T: ?Sized> Deref for CppMutRef<'a, T> {
272+
impl<T: ?Sized> Deref for CppMutRef<'_, T> {
273273
type Target = *const T;
274274
#[inline]
275275
fn deref(&self) -> &Self::Target {
@@ -283,7 +283,7 @@ impl<'a, T: ?Sized> Deref for CppMutRef<'a, T> {
283283
}
284284
}
285285

286-
impl<'a, T: ?Sized> Clone for CppMutRef<'a, T> {
286+
impl<T: ?Sized> Clone for CppMutRef<'_, T> {
287287
fn clone(&self) -> Self {
288288
Self {
289289
ptr: self.ptr,
@@ -316,7 +316,7 @@ pub trait AsCppMutRef<T: ?Sized>: AsCppRef<T> {
316316
fn as_cpp_mut_ref(&mut self) -> CppMutRef<T>;
317317
}
318318

319-
impl<'a, T: ?Sized> AsCppRef<T> for CppMutRef<'a, T> {
319+
impl<T: ?Sized> AsCppRef<T> for CppMutRef<'_, T> {
320320
fn as_cpp_ref(&self) -> CppRef<T> {
321321
CppRef::from_ptr(self.ptr)
322322
}

src/rvalue_param.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ unsafe impl<T> RValueParam<T> for Pin<Box<T>> {
6363
}
6464
}
6565

66-
unsafe impl<'a, T> RValueParam<T> for Pin<MoveRef<'a, T>> {
66+
unsafe impl<T> RValueParam<T> for Pin<MoveRef<'_, T>> {
6767
fn get_ptr(stack: Pin<&mut Self>) -> *mut T {
6868
// Safety: we won't move/swap the contents of the outer pin, nor of the
6969
// type stored within the UniquePtr.

0 commit comments

Comments
 (0)