Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
clippy: fix clippy warnings for Rust 1.71
Browse files Browse the repository at this point in the history
fixes: #300

Signed-off-by: Chao Wu <[email protected]>
  • Loading branch information
studychao committed Jul 15, 2023
1 parent 0671f18 commit 3b17110
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/dbs-arch/src/x86_64/cpuid/transformer/amd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ mod test {
// Check that if index == 0 the entry is processed
let vm_spec =
VmSpec::new(0, 1, 1, 1, 1, VpmuFeatureLevel::Disabled).expect("Error creating vm_spec");
let mut entry = &mut CpuIdEntry {
let entry = &mut CpuIdEntry {
function: cpu_leaf::leaf_0x7::LEAF_NUM,
index: 0,
flags: 0,
Expand Down
14 changes: 7 additions & 7 deletions crates/dbs-upcall/src/dev_mgr_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl DevMgrRequest {
pub fn build(&self) -> Box<[u8; DEV_MGR_MSG_SIZE]> {
let buffer = Box::new([0; DEV_MGR_MSG_SIZE]);
let size_hdr = mem::size_of::<DevMgrMsgHeader>();
let mut msg_hdr = unsafe { &mut *(buffer.as_ptr() as *mut DevMgrMsgHeader) };
let msg_hdr = unsafe { &mut *(buffer.as_ptr() as *mut DevMgrMsgHeader) };

msg_hdr.magic_version = DEV_MGR_MAGIC_VERSION;
msg_hdr.msg_flags = 0;
Expand Down Expand Up @@ -396,7 +396,7 @@ mod tests {
// test cpu response
{
let buffer = [0; DEV_MGR_MSG_SIZE];
let mut msg_hdr = unsafe { &mut *(buffer.as_ptr() as *mut DevMgrMsgHeader) };
let msg_hdr = unsafe { &mut *(buffer.as_ptr() as *mut DevMgrMsgHeader) };

msg_hdr.magic_version = DEV_MGR_MAGIC_VERSION;

Expand All @@ -407,7 +407,7 @@ mod tests {
let result = unsafe { &mut *(buffer[size_hdr..].as_ptr() as *mut i32) };
*result = 0;

let mut vcpu_result = unsafe {
let vcpu_result = unsafe {
&mut *(buffer[(size_hdr + mem::size_of::<u32>())..].as_ptr() as *mut CpuDevResponse)
};

Expand Down Expand Up @@ -435,7 +435,7 @@ mod tests {
// test add mmio response
{
let buffer = [0; DEV_MGR_MSG_SIZE];
let mut msg_hdr = unsafe { &mut *(buffer.as_ptr() as *mut DevMgrMsgHeader) };
let msg_hdr = unsafe { &mut *(buffer.as_ptr() as *mut DevMgrMsgHeader) };

msg_hdr.magic_version = DEV_MGR_MAGIC_VERSION;

Expand All @@ -457,7 +457,7 @@ mod tests {
// test result error
{
let buffer = [0; DEV_MGR_MSG_SIZE];
let mut msg_hdr = unsafe { &mut *(buffer.as_ptr() as *mut DevMgrMsgHeader) };
let msg_hdr = unsafe { &mut *(buffer.as_ptr() as *mut DevMgrMsgHeader) };

msg_hdr.magic_version = DEV_MGR_MAGIC_VERSION;

Expand All @@ -479,7 +479,7 @@ mod tests {
// test invalid unknown msg flag
{
let buffer = [0; DEV_MGR_MSG_SIZE];
let mut msg_hdr = unsafe { &mut *(buffer.as_ptr() as *mut DevMgrMsgHeader) };
let msg_hdr = unsafe { &mut *(buffer.as_ptr() as *mut DevMgrMsgHeader) };

msg_hdr.magic_version = DEV_MGR_MAGIC_VERSION;

Expand Down Expand Up @@ -551,7 +551,7 @@ mod tests {
let dev_mgr_service = DevMgrService {};

let buffer = [0; DEV_MGR_MSG_SIZE];
let mut msg_hdr = unsafe { &mut *(buffer.as_ptr() as *mut DevMgrMsgHeader) };
let msg_hdr = unsafe { &mut *(buffer.as_ptr() as *mut DevMgrMsgHeader) };
msg_hdr.magic_version = DEV_MGR_MAGIC_VERSION;
msg_hdr.msg_type = DevMgrMsgType::AddMmio as u32;
msg_hdr.msg_size = 0;
Expand Down

0 comments on commit 3b17110

Please sign in to comment.