clippy: Fix redundant allocations

With the new beta version, clippy complains about redundant allocation
when using Arc<Box<dyn T>>, and suggests replacing it simply with
Arc<dyn T>.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2021-07-29 11:15:10 +02:00
parent 91bd4ee8cc
commit dcc646f5b1
18 changed files with 57 additions and 66 deletions

View File

@@ -136,8 +136,7 @@ pub trait InterruptManager: Send + Sync {
/// * interrupt_type: type of interrupt source.
/// * base: base Interrupt Source ID to be managed by the group object.
/// * count: number of Interrupt Sources to be managed by the group object.
fn create_group(&self, config: Self::GroupConfig)
-> Result<Arc<Box<dyn InterruptSourceGroup>>>;
fn create_group(&self, config: Self::GroupConfig) -> Result<Arc<dyn InterruptSourceGroup>>;
/// Destroy an [InterruptSourceGroup](trait.InterruptSourceGroup.html) object created by
/// [create_group()](trait.InterruptManager.html#tymethod.create_group).
@@ -145,7 +144,7 @@ pub trait InterruptManager: Send + Sync {
/// Assume the caller takes the responsibility to disable all interrupt sources of the group
/// before calling destroy_group(). This assumption helps to simplify InterruptSourceGroup
/// implementations.
fn destroy_group(&self, group: Arc<Box<dyn InterruptSourceGroup>>) -> Result<()>;
fn destroy_group(&self, group: Arc<dyn InterruptSourceGroup>) -> Result<()>;
}
pub trait InterruptSourceGroup: Send + Sync {