mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-03-04 08:03:55 +00:00
pci: Fix clippy (return_self_not_must_use) issue
warning: missing `#[must_use]` attribute on a method returning `Self` --> pci/src/configuration.rs:925:5 | 925 | / pub fn set_register_index(mut self, reg_idx: usize) -> Self { 926 | | self.reg_idx = reg_idx; 927 | | self 928 | | } | |_____^ | = note: `#[warn(clippy::return_self_not_must_use)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use warning: missing `#[must_use]` attribute on a method returning `Self` --> pci/src/configuration.rs:930:5 | 930 | / pub fn set_address(mut self, addr: u64) -> Self { 931 | | self.addr = addr; 932 | | self 933 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use warning: missing `#[must_use]` attribute on a method returning `Self` --> pci/src/configuration.rs:935:5 | 935 | / pub fn set_size(mut self, size: u64) -> Self { 936 | | self.size = size; 937 | | self 938 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use warning: missing `#[must_use]` attribute on a method returning `Self` --> pci/src/configuration.rs:944:5 | 944 | / pub fn set_region_type(mut self, region_type: PciBarRegionType) -> Self { 945 | | self.region_type = region_type; 946 | | self 947 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
3baebc1af0
commit
221c1f1bdc
@ -922,16 +922,19 @@ impl PciBarConfiguration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
pub fn set_register_index(mut self, reg_idx: usize) -> Self {
|
pub fn set_register_index(mut self, reg_idx: usize) -> Self {
|
||||||
self.reg_idx = reg_idx;
|
self.reg_idx = reg_idx;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
pub fn set_address(mut self, addr: u64) -> Self {
|
pub fn set_address(mut self, addr: u64) -> Self {
|
||||||
self.addr = addr;
|
self.addr = addr;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
pub fn set_size(mut self, size: u64) -> Self {
|
pub fn set_size(mut self, size: u64) -> Self {
|
||||||
self.size = size;
|
self.size = size;
|
||||||
self
|
self
|
||||||
@ -941,6 +944,7 @@ impl PciBarConfiguration {
|
|||||||
self.size
|
self.size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
pub fn set_region_type(mut self, region_type: PciBarRegionType) -> Self {
|
pub fn set_region_type(mut self, region_type: PciBarRegionType) -> Self {
|
||||||
self.region_type = region_type;
|
self.region_type = region_type;
|
||||||
self
|
self
|
||||||
|
Loading…
x
Reference in New Issue
Block a user