Skip to content

Commit

Permalink
Clippy fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed Dec 9, 2024
1 parent 2de026d commit b33af8d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/nn/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct Func<'a> {
f: Box<dyn 'a + Fn(&Tensor) -> Tensor + Send>,
}

impl<'a> std::fmt::Debug for Func<'a> {
impl std::fmt::Debug for Func<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "func")
}
Expand All @@ -19,7 +19,7 @@ where
Func { f: Box::new(f) }
}

impl<'a> super::module::Module for Func<'a> {
impl super::module::Module for Func<'_> {
fn forward(&self, xs: &Tensor) -> Tensor {
(*self.f)(xs)
}
Expand All @@ -31,7 +31,7 @@ pub struct FuncT<'a> {
f: Box<dyn 'a + Fn(&Tensor, bool) -> Tensor + Send>,
}

impl<'a> std::fmt::Debug for FuncT<'a> {
impl std::fmt::Debug for FuncT<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "funcT")
}
Expand All @@ -44,7 +44,7 @@ where
FuncT { f: Box::new(f) }
}

impl<'a> super::module::ModuleT for FuncT<'a> {
impl super::module::ModuleT for FuncT<'_> {
fn forward_t(&self, xs: &Tensor, train: bool) -> Tensor {
(*self.f)(xs, train)
}
Expand Down
2 changes: 1 addition & 1 deletion src/nn/var_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ impl<'a> Path<'a> {
}
}

impl<'a> Entry<'a> {
impl Entry<'_> {
/// Returns the existing entry if, otherwise create a new variable.
///
/// If this entry name matches the name of a variables stored in the
Expand Down
2 changes: 1 addition & 1 deletion src/tensor/safetensors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl<'a> TryFrom<&'a Tensor> for SafeView<'a> {
}
}

impl<'a> View for SafeView<'a> {
impl View for SafeView<'_> {
fn dtype(&self) -> Dtype {
self.dtype
}
Expand Down
4 changes: 2 additions & 2 deletions torch-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ impl SystemInfo {
.pic(true)
.warnings(false)
.includes(&self.libtorch_include_dirs)
.flag(format!("-Wl,-rpath={}", self.libtorch_lib_dir.display()))
.flag(&format!("-Wl,-rpath={}", self.libtorch_lib_dir.display()))

Check failure on line 380 in torch-sys/build.rs

View workflow job for this annotation

GitHub Actions / Clippy

the borrowed expression implements the required traits

Check failure on line 380 in torch-sys/build.rs

View workflow job for this annotation

GitHub Actions / Clippy

the borrowed expression implements the required traits
.flag("-std=c++17")
.flag(format!("-D_GLIBCXX_USE_CXX11_ABI={}", self.cxx11_abi))
.flag(&format!("-D_GLIBCXX_USE_CXX11_ABI={}", self.cxx11_abi))

Check failure on line 382 in torch-sys/build.rs

View workflow job for this annotation

GitHub Actions / Clippy

the borrowed expression implements the required traits

Check failure on line 382 in torch-sys/build.rs

View workflow job for this annotation

GitHub Actions / Clippy

the borrowed expression implements the required traits
.flag("-DGLOG_USE_GLOG_EXPORT")
.files(&c_files)
.compile("tch");
Expand Down

0 comments on commit b33af8d

Please sign in to comment.