mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 20:24:31 +00:00
agent/uevent: Better initialize Uevent in test
We had some code that initialized a Uevent to the default value, then set specific fields to various values. This can be accomplished inside the one initialized using the ..Default::default() syntax. Making this change stops clippy from complaining. fixes #1611 Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
b0190a407f
commit
7b83b7ec1f
@ -245,11 +245,13 @@ mod tests {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_wait_for_uevent() {
|
async fn test_wait_for_uevent() {
|
||||||
let mut uev = crate::uevent::Uevent::default();
|
let uev = Uevent {
|
||||||
uev.action = crate::linux_abi::U_EVENT_ACTION_ADD.to_string();
|
action: crate::linux_abi::U_EVENT_ACTION_ADD.to_string(),
|
||||||
uev.subsystem = "test".to_string();
|
subsystem: "test".to_string(),
|
||||||
uev.devpath = "/test/sysfs/path".to_string();
|
devpath: "/test/sysfs/path".to_string(),
|
||||||
uev.devname = "testdevname".to_string();
|
devname: "testdevname".to_string(),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
let matcher = AlwaysMatch();
|
let matcher = AlwaysMatch();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user