Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
idavis committed Sep 13, 2024
1 parent 6ba181e commit 22fd89e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pyqir/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand All @@ -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.
Expand Down Expand Up @@ -268,7 +273,9 @@ impl Module {
/// :rtype: typing.Optional[str]
pub fn link(&self, other: Py<Module>, py: Python) -> Option<String> {
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());
Expand Down

0 comments on commit 22fd89e

Please sign in to comment.