From 22fd89e7452448532f64e22feb1f05c0be693bf7 Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Fri, 13 Sep 2024 13:25:04 -0700 Subject: [PATCH] Formatting --- pyqir/src/module.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pyqir/src/module.rs b/pyqir/src/module.rs index ccd53887..fcdfa2cc 100644 --- a/pyqir/src/module.rs +++ b/pyqir/src/module.rs @@ -9,6 +9,7 @@ use crate::{ metadata::Metadata, values::{Constant, Owner, Value}, }; +use core::mem::forget; use core::slice; #[allow(clippy::wildcard_imports, deprecated)] use llvm_sys::{ @@ -22,9 +23,13 @@ use llvm_sys::{ }; use pyo3::{exceptions::PyValueError, prelude::*, pyclass::CompareOp, types::PyBytes}; use qirlib::module::FlagBehavior; -use core::mem::forget; use std::{ - collections::hash_map::DefaultHasher, ffi::CString, hash::{Hash, Hasher}, ops::Deref, ptr::{self, NonNull}, str + collections::hash_map::DefaultHasher, + ffi::CString, + hash::{Hash, Hasher}, + ops::Deref, + ptr::{self, NonNull}, + str, }; /// A module is a collection of global values. @@ -268,7 +273,9 @@ impl Module { /// :rtype: typing.Optional[str] pub fn link(&self, other: Py, py: Python) -> Option { if self.context.borrow(py).as_ptr() != other.borrow(py).context.borrow(py).as_ptr() { - return Some("Cannot link modules from different contexts. Modules are untouched.".to_string()); + return Some( + "Cannot link modules from different contexts. Modules are untouched.".to_string(), + ); } unsafe { let result = LLVMLinkModules2(self.module.as_ptr(), other.borrow(py).module.as_ptr());