Skip to content

Commit

Permalink
Adjust rustfmt to avoid long function definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianFreudiger committed Jul 6, 2023
1 parent 4163489 commit c6a8de8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
edition = "2021"
fn_params_layout = "Compressed"
10 changes: 2 additions & 8 deletions libvfio-user/src/callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ macro_rules! device_context_from_vfu_ctx {
}

pub(crate) unsafe extern "C" fn log_callback<T: Device>(
vfu_ctx: *mut vfu_ctx_t,
level: c_int,
msg: *const c_char,
vfu_ctx: *mut vfu_ctx_t, level: c_int, msg: *const c_char,
) {
let device_context = device_context_from_vfu_ctx!(vfu_ctx);
let msg = unsafe { CStr::from_ptr(msg) };
Expand Down Expand Up @@ -54,11 +52,7 @@ impl DeviceRegionKind {
}

pub(crate) unsafe extern "C" fn region_access_callback<T: Device, const R: u8>(
vfu_ctx: *mut vfu_ctx_t,
buf: *mut c_char,
count: usize,
offset: loff_t,
is_write: bool,
vfu_ctx: *mut vfu_ctx_t, buf: *mut c_char, count: usize, offset: loff_t, is_write: bool,
) -> isize {
let device_context = device_context_from_vfu_ctx!(vfu_ctx);
let device = &mut device_context.device;
Expand Down

0 comments on commit c6a8de8

Please sign in to comment.