Skip to content

Commit 5ba14c8

Browse files
aapoalasahl
andauthored
ahl: Reflow for better readability
Co-authored-by: Adam Leventhal <adam.leventhal@gmail.com>
1 parent dbbc907 commit 5ba14c8

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

usdt-impl/src/common.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,17 @@ pub(crate) fn asm_type_convert(typ: &DataType, input: TokenStream) -> (TokenStre
229229
),
230230
DataType::Native(_) => {
231231
let ty = typ.to_rust_type();
232-
(
233-
// For STAPSDT probes, we cannot "widen" the data type at the
232+
#[cfg(not(usdt_backend_stapsdt))]
233+
let value quote! { (*<_ as ::std::borrow::Borrow<#ty>>::borrow(&#input) as usize) };
234+
235+
// For STAPSDT probes, we cannot "widen" the data type at the
234236
// interface, as we've left the register choice up to the
235237
// compiler and the compiler doesn't like mismatched register
236238
// classes and types for single-byte values (reg_byte vs usize).
237239
#[cfg(usdt_backend_stapsdt)]
238-
quote! { (*<_ as ::std::borrow::Borrow<#ty>>::borrow(&#input)) },
239-
#[cfg(not(usdt_backend_stapsdt))]
240-
quote! { (*<_ as ::std::borrow::Borrow<#ty>>::borrow(&#input) as usize) },
240+
let value = quote! { (*<_ as ::std::borrow::Borrow<#ty>>::borrow(&#input)) };
241+
(
242+
value
241243
quote! {},
242244
)
243245
}

0 commit comments

Comments
 (0)