Skip to content

Commit

Permalink
chore(hlapi): fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeul-zama committed Jun 26, 2024
1 parent ebfa153 commit 3573f0e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
5 changes: 2 additions & 3 deletions tfhe/src/high_level_api/booleans/inner.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::backward_compatibility::booleans::InnerBooleanVersionedOwned;
use crate::high_level_api::details::MaybeCloned;
use crate::high_level_api::global_state;
#[cfg(feature = "gpu")]
use crate::high_level_api::global_state::{self, with_thread_local_cuda_streams};
use crate::high_level_api::global_state::with_thread_local_cuda_streams;
use crate::integer::BooleanBlock;
use crate::Device;
use serde::{Deserializer, Serializer};
Expand Down Expand Up @@ -219,9 +220,7 @@ impl InnerBoolean {
}

#[inline]
#[allow(clippy::unused_self, clippy::needless_pass_by_ref_mut)]
pub(crate) fn move_to_device_of_server_key_if_set(&mut self) {
#[cfg(feature = "gpu")]
if let Some(device) = global_state::device_of_internal_keys() {
self.move_to_device(device);
}
Expand Down
1 change: 0 additions & 1 deletion tfhe/src/high_level_api/global_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ where
})
}

#[cfg(feature = "gpu")]
#[inline]
pub(in crate::high_level_api) fn device_of_internal_keys() -> Option<crate::Device> {
// Should use `with_borrow` when its stabilized
Expand Down
5 changes: 2 additions & 3 deletions tfhe/src/high_level_api/integers/signed/inner.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::backward_compatibility::integers::SignedRadixCiphertextVersionedOwned;
use crate::high_level_api::details::MaybeCloned;
use crate::high_level_api::global_state;
#[cfg(feature = "gpu")]
use crate::high_level_api::global_state::{self, with_thread_local_cuda_streams};
use crate::high_level_api::global_state::with_thread_local_cuda_streams;
#[cfg(feature = "gpu")]
use crate::integer::gpu::ciphertext::CudaIntegerRadixCiphertext;
#[cfg(feature = "gpu")]
Expand Down Expand Up @@ -208,9 +209,7 @@ impl RadixCiphertext {
}

#[inline]
#[allow(clippy::unused_self, clippy::needless_pass_by_ref_mut)]
pub(crate) fn move_to_device_of_server_key_if_set(&mut self) {
#[cfg(feature = "gpu")]
if let Some(device) = global_state::device_of_internal_keys() {
self.move_to_device(device);
}
Expand Down
5 changes: 2 additions & 3 deletions tfhe/src/high_level_api/integers/unsigned/inner.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::backward_compatibility::integers::UnsignedRadixCiphertextVersionedOwned;
use crate::high_level_api::details::MaybeCloned;
use crate::high_level_api::global_state;
#[cfg(feature = "gpu")]
use crate::high_level_api::global_state::{self, with_thread_local_cuda_streams};
use crate::high_level_api::global_state::with_thread_local_cuda_streams;
#[cfg(feature = "gpu")]
use crate::integer::gpu::ciphertext::CudaIntegerRadixCiphertext;
use crate::Device;
Expand Down Expand Up @@ -213,9 +214,7 @@ impl RadixCiphertext {
}

#[inline]
#[allow(clippy::unused_self, clippy::needless_pass_by_ref_mut)]
pub(crate) fn move_to_device_of_server_key_if_set(&mut self) {
#[cfg(feature = "gpu")]
if let Some(device) = global_state::device_of_internal_keys() {
self.move_to_device(device);
}
Expand Down

0 comments on commit 3573f0e

Please sign in to comment.