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

Fix clippy::doc_lazy_continuation lints #3658

Merged
merged 1 commit into from
Jul 25, 2024
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
12 changes: 6 additions & 6 deletions src/engine/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ pub trait KeyActions {
///
/// Successful return values:
/// * `Ok(MappingCreateAction::Identity)`: The key was already in the keyring
/// with the appropriate key description and key data.
/// with the appropriate key description and key data.
/// * `Ok(MappingCreateAction::Created(_))`: The key was newly added to the
/// keyring.
/// keyring.
/// * `Ok(MappingCreateAction::Changed)`: The key description was already present
/// in the keyring but the key data was updated.
/// in the keyring but the key data was updated.
fn set(
&self,
key_desc: &KeyDescription,
Expand Down Expand Up @@ -133,11 +133,11 @@ pub trait Pool: Debug + Send + Sync {
/// Returns a list of the the block devices that were actually added as cache
/// devices. In practice, this will have three types of return values:
/// * An error if the cache has already been initialized with a different set
/// of block devices.
/// of block devices.
/// * `SetCreateAction::Identity` if the cache has already been initialized with
/// the same set of block devices.
/// the same set of block devices.
/// * `SetCreateAction::Created` containing all provided block devices if the
/// cache has not yet been initialized.
/// cache has not yet been initialized.
///
/// This ensures the contract of providing a truly idempotent API as the cache
/// can only be initialized once and if an attempt is made to initialize it
Expand Down
22 changes: 11 additions & 11 deletions src/engine/strat_engine/backstore/backstore/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ impl Backstore {
///
/// Precondition:
/// * key_description.is_some() -> every StratBlockDev in datadevs has a
/// key description and that key description == key_description
/// key description and that key description == key_description
/// * key_description.is_none() -> no StratBlockDev in datadevs has a
/// key description.
/// key description.
/// * no StratBlockDev in cachedevs has a key description
///
/// Postcondition:
Expand Down Expand Up @@ -625,7 +625,7 @@ impl Backstore {
/// * Ok(Some(uuid)) provides the uuid of the changed blockdev
/// * Ok(None) is returned if the blockdev was unchanged
/// * Err(StratisError::Engine(_)) is returned if the UUID
/// does not correspond to a blockdev
/// does not correspond to a blockdev
pub fn set_blockdev_user_info(
&mut self,
uuid: DevUuid,
Expand Down Expand Up @@ -676,9 +676,9 @@ impl Backstore {
///
/// * Returns Ok(true) if the binding was performed.
/// * Returns Ok(false) if the binding had already been previously performed and
/// nothing was changed.
/// nothing was changed.
/// * Returns Err(_) if an inconsistency was found in the metadata across pools
/// or binding failed.
/// or binding failed.
pub fn bind_clevis(&mut self, pin: &str, clevis_info: &Value) -> StratisResult<bool> {
let encryption_info = match pool_enc_to_enc!(self.encryption_info()) {
Some(ei) => ei,
Expand Down Expand Up @@ -733,9 +733,9 @@ impl Backstore {
///
/// * Returns Ok(true) if the unbinding was performed.
/// * Returns Ok(false) if the unbinding had already been previously performed and
/// nothing was changed.
/// nothing was changed.
/// * Returns Err(_) if an inconsistency was found in the metadata across pools
/// or unbinding failed.
/// or unbinding failed.
pub fn unbind_clevis(&mut self) -> StratisResult<bool> {
let encryption_info = match pool_enc_to_enc!(self.encryption_info()) {
Some(ei) => ei,
Expand All @@ -762,9 +762,9 @@ impl Backstore {
///
/// * Returns Ok(true) if the binding was performed.
/// * Returns Ok(false) if the binding had already been previously performed and
/// nothing was changed.
/// nothing was changed.
/// * Returns Err(_) if an inconsistency was found in the metadata across pools
/// or binding failed.
/// or binding failed.
pub fn bind_keyring(&mut self, key_desc: &KeyDescription) -> StratisResult<bool> {
let encryption_info = match pool_enc_to_enc!(self.encryption_info()) {
Some(ei) => ei,
Expand Down Expand Up @@ -817,9 +817,9 @@ impl Backstore {
///
/// * Returns Ok(true) if the unbinding was performed.
/// * Returns Ok(false) if the unbinding had already been previously performed and
/// nothing was changed.
/// nothing was changed.
/// * Returns Err(_) if an inconsistency was found in the metadata across pools
/// or unbinding failed.
/// or unbinding failed.
pub fn unbind_keyring(&mut self) -> StratisResult<bool> {
let encryption_info = match pool_enc_to_enc!(self.encryption_info()) {
Some(ei) => ei,
Expand Down
14 changes: 7 additions & 7 deletions src/engine/strat_engine/backstore/backstore/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ impl Backstore {
///
/// Precondition:
/// * key_description.is_some() -> every StratBlockDev in datadevs has a
/// key description and that key description == key_description
/// key description and that key description == key_description
/// * key_description.is_none() -> no StratBlockDev in datadevs has a
/// key description.
/// key description.
/// * no StratBlockDev in cachedevs has a key description
///
/// Postcondition:
Expand Down Expand Up @@ -874,7 +874,7 @@ impl Backstore {
/// * Ok(Some(uuid)) provides the uuid of the changed blockdev
/// * Ok(None) is returned if the blockdev was unchanged
/// * Err(StratisError::Engine(_)) is returned if the UUID
/// does not correspond to a blockdev
/// does not correspond to a blockdev
pub fn set_blockdev_user_info(
&mut self,
uuid: DevUuid,
Expand Down Expand Up @@ -916,7 +916,7 @@ impl Backstore {
///
/// * Returns Ok(true) if the binding was performed.
/// * Returns Ok(false) if the binding had already been previously performed and
/// nothing was changed.
/// nothing was changed.
/// * Returns Err(_) if binding failed.
pub fn bind_clevis(&mut self, pin: &str, clevis_info: &Value) -> StratisResult<bool> {
let handle = self
Expand Down Expand Up @@ -961,7 +961,7 @@ impl Backstore {
///
/// * Returns Ok(true) if the unbinding was performed.
/// * Returns Ok(false) if the unbinding had already been previously performed and
/// nothing was changed.
/// nothing was changed.
/// * Returns Err(_) if unbinding failed.
pub fn unbind_clevis(&mut self) -> StratisResult<bool> {
let handle = self
Expand All @@ -987,7 +987,7 @@ impl Backstore {
///
/// * Returns Ok(true) if the binding was performed.
/// * Returns Ok(false) if the binding had already been previously performed and
/// nothing was changed.
/// nothing was changed.
/// * Returns Err(_) if binding failed.
pub fn bind_keyring(&mut self, key_desc: &KeyDescription) -> StratisResult<bool> {
let handle = self
Expand Down Expand Up @@ -1022,7 +1022,7 @@ impl Backstore {
///
/// * Returns Ok(true) if the unbinding was performed.
/// * Returns Ok(false) if the unbinding had already been previously performed and
/// nothing was changed.
/// nothing was changed.
/// * Returns Err(_) if unbinding failed.
pub fn unbind_keyring(&mut self) -> StratisResult<bool> {
let handle = self
Expand Down
2 changes: 1 addition & 1 deletion src/engine/strat_engine/backstore/blockdev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub trait InternalBlockDev {
///
/// Returns:
/// * `None` if the size hasn't changed or is equal to the current size recorded
/// in the metadata.
/// in the metadata.
/// * Otherwise, `Some(_)`
fn calc_new_size(&self) -> StratisResult<Option<Sectors>>;

Expand Down
5 changes: 3 additions & 2 deletions src/engine/strat_engine/backstore/blockdev/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ impl StratBlockDev {
/// - hardware_info: identifying information in the hardware
/// - key_description: optional argument enabling encryption using
/// the specified key in the kernel keyring
///
/// Returns an error if it is impossible to allocate all segments on the
/// device.
/// NOTE: It is possible that the actual device size is greater than
Expand Down Expand Up @@ -226,9 +227,9 @@ impl StratBlockDev {
///
/// Returns:
/// * Some(Some(_)) if the pool is encrypted and the pool name is set in the
/// metadata
/// metadata
/// * Some(None) if the pool is encrypted and the pool name is not set in the
/// metadata
/// metadata
/// * None if the pool is not encrypted
#[allow(clippy::option_option)]
pub fn pool_name(&self) -> Option<Option<&Name>> {
Expand Down
1 change: 1 addition & 0 deletions src/engine/strat_engine/backstore/blockdev/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ impl StratBlockDev {
/// - hardware_info: identifying information in the hardware
/// - key_description: optional argument enabling encryption using
/// the specified key in the kernel keyring
///
/// Returns an error if it is impossible to allocate all segments on the
/// device.
/// NOTE: It is possible that the actual device size is greater than
Expand Down
2 changes: 1 addition & 1 deletion src/engine/strat_engine/backstore/range_alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::{
/// It enforces some invariants:
/// * No 0 length segment
/// * No contiguous segments; if two segments would be contiguous they are
/// coalesced into a single segment.
/// coalesced into a single segment.
/// * No overlapping segments
/// * No segments that extend beyond limit
#[derive(Debug, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion src/engine/strat_engine/crypt/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pub fn device_from_physical_path(physical_path: &Path) -> StratisResult<Option<C
/// This method returns:
/// * Ok(Some(_)) if a Clevis token was detected
/// * Ok(None) if no token in the Clevis slot was detected or a token was detected
/// but does not appear to be a Clevis token
/// but does not appear to be a Clevis token
/// * Err(_) if the token appears to be a Clevis token but is malformed in some way
pub fn clevis_info_from_metadata(
device: &mut CryptDevice,
Expand Down
4 changes: 2 additions & 2 deletions src/engine/strat_engine/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ fn set_key(
///
/// Successful return values:
/// * `Ok(MappingCreateAction::Identity)`: The key was already in the keyring with the
/// appropriate key description and key data.
/// appropriate key description and key data.
/// * `Ok(MappingCreateAction::Created(()))`: The key was newly added to the keyring.
/// * `Ok(MappingCreateAction::ValueChanged(()))`: The key description was already present
/// in the keyring but the key data was updated.
/// in the keyring but the key data was updated.
fn set_key_idem(
key_desc: &KeyDescription,
key_data: SizedKeyMemory,
Expand Down
2 changes: 1 addition & 1 deletion src/engine/strat_engine/liminal/identify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ mod tests {
/// recognized.
///
/// * Verify that the physical paths are recognized as LUKS devices
/// belonging to Stratis.
/// belonging to Stratis.
/// * Verify that the physical paths are not recognized as Stratis devices.
/// * Verify that the metadata paths are recognized as Stratis devices.
fn test_process_luks_device_initialized(paths: &[&Path]) {
Expand Down
4 changes: 2 additions & 2 deletions src/engine/strat_engine/metadata/mda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ impl MDARegions {
#[cfg(test)]
/// An invariant on MDARegions structs.
/// 1. If an MDAHeader in the regions is not None, then its used
/// attribute must be greater than 0.
/// attribute must be greater than 0.
/// 2. If an MDAHeader in the regions is not None, then its used
/// attribute must be no greater than the region allocated for it.
/// attribute must be no greater than the region allocated for it.
pub fn invariant(&self) {
let space_for_data = self.region_size.data_size().bytes();
for mda in self.mda_headers.iter().flatten() {
Expand Down
2 changes: 2 additions & 0 deletions src/engine/strat_engine/metadata/sizes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pub mod mda_size {
/// It is constructed in one of two ways:
/// * By reading a value from a device in constructing a StaticHeader
/// * MDARegionSize::mda_size
///
/// Since only a valid MDASize can be constructed, only a valid MDASize
/// can be written. An error on reading ought to be detected by
/// checksums.
Expand Down Expand Up @@ -98,6 +99,7 @@ pub mod mda_size {
/// Values of this type are created by one of two methods:
/// * MDASize::region_size
/// * MDADataSize::region_size
///
/// Since an MDADataSize is always at least the minimum required by the
/// design specification, MDADataSize::region_size() always yields a
/// value of at least the minimum required size.
Expand Down
8 changes: 4 additions & 4 deletions src/engine/structures/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ where
U: AsUuid,
{
/// * Asserts that tasks performing an actions either are performing an action immediately
/// after being spawned or are in the list of woken tasks.
/// after being spawned or are in the list of woken tasks.
///
/// NOTE: This method has the side effect of clearing a woken waiter if it is the waiter that
/// is currently acquiring the lock.
Expand All @@ -159,9 +159,9 @@ where
}

/// * Asserts that tasks performing an actions either are performing an action immediately
/// after being spawned or are in the list of woken tasks.
/// after being spawned or are in the list of woken tasks.
/// * Asserts that the current task never conflicts with tasks that have been woken but
/// not processed yet.
/// not processed yet.
///
/// NOTE: This method has the side effect of clearing a woken waiter if it is the waiter that
/// is currently acquiring the lock.
Expand Down Expand Up @@ -291,7 +291,7 @@ where

/// Returns true if the current request should be put in the wait queue.
/// * Always returns false if the index for the given request is in the record of woken
/// tasks.
/// tasks.
/// * Otherwise, returns true if either of the following conditions are met:
/// * The lock already has a conflicting acquisition.
/// * The request conflicts with any tasks that have already been woken up.
Expand Down
2 changes: 1 addition & 1 deletion src/engine/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl fmt::Display for Name {
/// This report may be fetched through `Report::engine_state_report()`.
///
/// * `ErroredPoolDevices` returns the state of devices that caused an error while
/// attempting to reconstruct a pool.
/// attempting to reconstruct a pool.
pub enum ReportType {
StoppedPools,
}
Expand Down
2 changes: 1 addition & 1 deletion stratisd_proc_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ fn process_item(mut item: Item) -> Item {
/// implementations. It provides two facilities:
/// * checking if the error returned should cause the pool to refuse mutating actions.
/// * returning an error if the method called would cause a mutating action to occur if
/// the pool cannot accept mutating actions.
/// the pool cannot accept mutating actions.
///
/// This macro should be applied to `impl` items only.
#[proc_macro_attribute]
Expand Down
Loading