Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deny unused self parameters in clippy #2587

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ CLIPPY_PEDANTIC = -D clippy::await_holding_lock \
-D clippy::unreadable_literal \
-D clippy::unsafe_derive_deserialize \
-A clippy::unseparated_literal_suffix \
-A clippy::unused_self \
-D clippy::unused_self \
-D clippy::used_underscore_binding \
-D clippy::used_underscore_binding \
-D clippy::verbose_bit_mask \
Expand Down
1 change: 1 addition & 0 deletions src/engine/sim_engine/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ impl SimPool {
self.encryption_info().is_encrypted()
}

#[allow(clippy::unused_self)]
pub fn destroy(&mut self) -> StratisResult<()> {
Ok(())
}
Expand Down
5 changes: 2 additions & 3 deletions src/engine/strat_engine/backstore/crypt/initialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ impl CryptInitializer {

/// Initialize with a passphrase in the kernel keyring only.
fn initialize_with_keyring(
&self,
device: &mut CryptDevice,
key_description: &KeyDescription,
) -> StratisResult<()> {
Expand Down Expand Up @@ -187,7 +186,7 @@ impl CryptInitializer {
key_description: &KeyDescription,
(pin, json, yes): (&str, &Value, bool),
) -> StratisResult<()> {
self.initialize_with_keyring(&mut device, key_description)?;
Self::initialize_with_keyring(&mut device, key_description)?;

let fs = MemoryPrivateFilesystem::new()?;
fs.key_op(key_description, |kf| {
Expand Down Expand Up @@ -228,7 +227,7 @@ impl CryptInitializer {
self.acquire_crypt_device()?
}
(Some(kd), _) => {
self.initialize_with_keyring(&mut device, kd)?;
Self::initialize_with_keyring(&mut device, kd)?;
device
}
(_, Some(ci)) => {
Expand Down
1 change: 0 additions & 1 deletion src/engine/strat_engine/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ impl StratKeyActions {
/// of the key. This method is only useful for testing stratisd internally. It
/// is not useful for testing using D-Bus.
pub fn set_no_fd(
&mut self,
key_desc: &KeyDescription,
key: SizedKeyMemory,
) -> StratisResult<MappingCreateAction<Key>> {
Expand Down
2 changes: 1 addition & 1 deletion src/engine/strat_engine/tests/crypt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ where
.unwrap();
let key_data = SizedKeyMemory::new(mem, MAX_STRATIS_PASS_SIZE);

key_handle.set_no_fd(&key_description, key_data)?;
StratKeyActions::set_no_fd(&key_description, key_data)?;

let result = test(physical_paths, &key_description, input);

Expand Down
4 changes: 2 additions & 2 deletions src/engine/strat_engine/thinpool/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl StratFilesystem {
if free_bytes.sectors() < FILESYSTEM_LOWATER {
let mut table = self.thin_dev.table().table.clone();
table.length =
self.thin_dev.size() + self.extend_size(self.thin_dev.size());
self.thin_dev.size() + Self::extend_size(self.thin_dev.size());
if self.thin_dev.set_table(get_dm(), table).is_err() {
return Ok(false);
}
Expand All @@ -260,7 +260,7 @@ impl StratFilesystem {
/// Return an extend size for the thindev under the filesystem
/// TODO: returning the current size will double the space provisioned to
/// the thin device. We should determine if this is a reasonable value.
fn extend_size(&self, current_size: Sectors) -> Sectors {
fn extend_size(current_size: Sectors) -> Sectors {
current_size
}

Expand Down