Skip to content

VolumeManager::device expects time source as return valueΒ #195

@fko-kuptec

Description

@fko-kuptec

The new API for temporarily accessing the block device expects the given closure to return something of type T:

/// Temporarily get access to the underlying block device.
pub fn device<F>(&self, f: F) -> T
where
    F: FnOnce(&mut D) -> T,
{
    let mut data = self.data.borrow_mut();
    let result = f(data.block_cache.block_device());
    result
}

I am pretty sure that T in this case is supposed to be an arbitrary type. However, the VolumeManager::device method does not declare T, it reuses the type parameter from the struct definition, which is the time source. This makes it hard to actually use this method, since it is expecting to return an instance of the time source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions