Issue 3223: reformat via cargo fmt

This commit is contained in:
Alexander McLin
2026-04-08 19:39:48 -04:00
parent fbc5345c9a
commit 091af28368
2 changed files with 70 additions and 70 deletions

View File

@@ -65,16 +65,16 @@ impl FunctionImpl {
Integer: From<T>,
T: Copy + TryInto<i64> + MightNotFitInFixnum,
{
let n = unsafe { self.cif.call::<T>(self.code_ptr, args) };
Ok(Value::Number(fixnum!(Number, n, arena)))
let n = unsafe { self.cif.call::<T>(self.code_ptr, args) };
Ok(Value::Number(fixnum!(Number, n, arena)))
}
unsafe fn call_float<T>(&self, args: &[Arg], _: &mut Arena) -> Result<Value, FfiError>
where
T: Into<f64>,
{
let n = unsafe { self.cif.call::<T>(self.code_ptr, args) };
Ok(Value::Number(Number::Float(OrderedFloat(n.into()))))
let n = unsafe { self.cif.call::<T>(self.code_ptr, args) };
Ok(Value::Number(Number::Float(OrderedFloat(n.into()))))
}
unsafe fn call_ptr(&self, args: &[Arg], arena: &mut Arena) -> Result<Value, FfiError> {
@@ -266,9 +266,9 @@ impl StructImpl {
let (new_layout, offset) = layout
.extend(Layout::new::<T>())
.map_err(|_| FfiError::LayoutError)?;
*layout = new_layout;
let n = unsafe { std::ptr::read::<T>(ptr.byte_offset(offset as isize).cast()) };
Ok(n)
*layout = new_layout;
let n = unsafe { std::ptr::read::<T>(ptr.byte_offset(offset as isize).cast()) };
Ok(n)
}
unsafe fn read_int<T>(
@@ -280,9 +280,8 @@ impl StructImpl {
T: Copy + TryInto<i64> + MightNotFitInFixnum,
Integer: From<T>,
{
let n = unsafe { read_primitive::<T>(ptr, layout)? };
Ok(Value::Number(fixnum!(Number, n, arena)))
let n = unsafe { read_primitive::<T>(ptr, layout)? };
Ok(Value::Number(fixnum!(Number, n, arena)))
}
unsafe fn read_float<T>(
@@ -292,8 +291,8 @@ impl StructImpl {
where
T: Into<f64>,
{
let n = unsafe { read_primitive::<T>(ptr, layout)? };
Ok(Value::Number(Number::Float(OrderedFloat(n.into()))))
let n = unsafe { read_primitive::<T>(ptr, layout)? };
Ok(Value::Number(Number::Float(OrderedFloat(n.into()))))
}
let mut layout = Layout::from_size_align(0, 1).map_err(|_| FfiError::LayoutError)?;
@@ -794,8 +793,8 @@ impl ForeignFunctionTable {
T: Copy + TryInto<i64> + MightNotFitInFixnum,
Integer: From<T>,
{
let n = unsafe { ptr.cast::<T>().read() };
Value::Number(fixnum!(Number, n, arena))
let n = unsafe { ptr.cast::<T>().read() };
Value::Number(fixnum!(Number, n, arena))
}
let ptr = ptr.as_ptr()?;