Skip to content

Commit

Permalink
Merge pull request #917 from LaurentMazare/clippy-fixes
Browse files Browse the repository at this point in the history
Clippy fixes.
  • Loading branch information
LaurentMazare authored Dec 9, 2024
2 parents 2de026d + eb8d34f commit 78a1f57
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 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
2 changes: 1 addition & 1 deletion torch-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ libc = "0.2.0"

[build-dependencies]
anyhow = "^1.0.60"
cc = "1.0.61"
cc = "1.2"
ureq = { version = "2.6", optional = true, features = ["json"] }
serde_json = { version = "1.0", optional = true }
serde = { version = "1.0", optional = true, features = ["derive"] }
Expand Down

0 comments on commit 78a1f57

Please sign in to comment.