mirror of
https://github.com/huggingface/candle.git
synced 2025-06-15 02:16:37 +00:00
Lint fixes introduced with Rust 1.83 (#2646)
* Fixes for lint errors introduced with Rust 1.83 * rustfmt * Fix more lints. --------- Co-authored-by: Laurent <laurent.mazare@gmail.com>
This commit is contained in:

committed by
GitHub

parent
23ed8a9ded
commit
54e7fc3c97
@ -9,7 +9,7 @@ pub struct Func<'a> {
|
||||
f: Arc<dyn 'a + Fn(&Tensor) -> Result<Tensor> + Send + Sync>,
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
@ -22,7 +22,7 @@ where
|
||||
Func { f: Arc::new(f) }
|
||||
}
|
||||
|
||||
impl<'a> super::Module for Func<'a> {
|
||||
impl super::Module for Func<'_> {
|
||||
fn forward(&self, xs: &Tensor) -> Result<Tensor> {
|
||||
(*self.f)(xs)
|
||||
}
|
||||
@ -44,7 +44,7 @@ pub struct FuncT<'a> {
|
||||
f: Arc<dyn 'a + Fn(&Tensor, bool) -> Result<Tensor> + Send + Sync>,
|
||||
}
|
||||
|
||||
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, "func")
|
||||
}
|
||||
@ -57,7 +57,7 @@ where
|
||||
FuncT { f: Arc::new(f) }
|
||||
}
|
||||
|
||||
impl<'a> super::ModuleT for FuncT<'a> {
|
||||
impl super::ModuleT for FuncT<'_> {
|
||||
fn forward_t(&self, xs: &Tensor, train: bool) -> Result<Tensor> {
|
||||
(*self.f)(xs, train)
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ pub struct VarBuilderArgs<'a, B: Backend> {
|
||||
_phantom: std::marker::PhantomData<&'a B>,
|
||||
}
|
||||
|
||||
impl<'a, B: Backend> Clone for VarBuilderArgs<'a, B> {
|
||||
impl<B: Backend> Clone for VarBuilderArgs<'_, B> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
data: self.data.clone(),
|
||||
@ -76,7 +76,7 @@ pub trait SimpleBackend: Send + Sync {
|
||||
fn contains_tensor(&self, name: &str) -> bool;
|
||||
}
|
||||
|
||||
impl<'a> Backend for Box<dyn SimpleBackend + 'a> {
|
||||
impl Backend for Box<dyn SimpleBackend + '_> {
|
||||
type Hints = crate::Init;
|
||||
fn get(
|
||||
&self,
|
||||
@ -94,7 +94,7 @@ impl<'a> Backend for Box<dyn SimpleBackend + 'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, B: Backend> VarBuilderArgs<'a, B> {
|
||||
impl<B: Backend> VarBuilderArgs<'_, B> {
|
||||
pub fn new_with_args(backend: B, dtype: DType, dev: &Device) -> Self {
|
||||
let data = TensorData {
|
||||
backend,
|
||||
@ -286,7 +286,7 @@ pub struct SafeTensorWithRouting<'a> {
|
||||
safetensors: Vec<SafeTensors<'a>>,
|
||||
}
|
||||
|
||||
impl<'a> SimpleBackend for SafeTensorWithRouting<'a> {
|
||||
impl SimpleBackend for SafeTensorWithRouting<'_> {
|
||||
fn get(
|
||||
&self,
|
||||
s: Shape,
|
||||
@ -439,7 +439,7 @@ impl SimpleBackend for candle::safetensors::BufferedSafetensors {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> SimpleBackend for candle::safetensors::SliceSafetensors<'a> {
|
||||
impl SimpleBackend for candle::safetensors::SliceSafetensors<'_> {
|
||||
fn get(
|
||||
&self,
|
||||
s: Shape,
|
||||
@ -732,7 +732,7 @@ pub struct Rename<'a, R: Renamer> {
|
||||
renamer: R,
|
||||
}
|
||||
|
||||
impl<'a, R: Renamer + Sync + Send> SimpleBackend for Rename<'a, R> {
|
||||
impl<R: Renamer + Sync + Send> SimpleBackend for Rename<'_, R> {
|
||||
fn get(
|
||||
&self,
|
||||
s: Shape,
|
||||
|
Reference in New Issue
Block a user