From e84e5e3a929c3b8bec9b2d8425e6ce652941b2f5 Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Thu, 19 Oct 2023 09:46:45 -0700 Subject: [PATCH] Formatting --- qirlib/src/values.rs | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/qirlib/src/values.rs b/qirlib/src/values.rs index 190a1d8e..36be3bb8 100644 --- a/qirlib/src/values.rs +++ b/qirlib/src/values.rs @@ -102,7 +102,11 @@ pub unsafe fn required_num_qubits(function: LLVMValueRef) -> Option { ) }) .or_else(|| { - get_string_attribute(function, LLVMAttributeFunctionIndex, b"num_required_qubits") + get_string_attribute( + function, + LLVMAttributeFunctionIndex, + b"num_required_qubits", + ) })?; let mut len = 0; @@ -116,21 +120,22 @@ pub unsafe fn required_num_qubits(function: LLVMValueRef) -> Option { pub unsafe fn required_num_results(function: LLVMValueRef) -> Option { if LLVMGetValueKind(function) == LLVMValueKind::LLVMFunctionValueKind { - let required_results = get_string_attribute( - function, - LLVMAttributeFunctionIndex, - b"requiredResults", - ) - .or_else(|| { - get_string_attribute( - function, - LLVMAttributeFunctionIndex, - b"required_num_results", - ) - }) - .or_else(|| { - get_string_attribute(function, LLVMAttributeFunctionIndex, b"num_required_results") - })?; + let required_results = + get_string_attribute(function, LLVMAttributeFunctionIndex, b"requiredResults") + .or_else(|| { + get_string_attribute( + function, + LLVMAttributeFunctionIndex, + b"required_num_results", + ) + }) + .or_else(|| { + get_string_attribute( + function, + LLVMAttributeFunctionIndex, + b"num_required_results", + ) + })?; let mut len = 0; let value = LLVMGetStringAttributeValue(required_results.as_ptr(), &mut len); let value = slice::from_raw_parts(value.cast(), len.try_into().unwrap());