Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
twizmwazin committed Nov 1, 2024
1 parent a32c474 commit 9e903ca
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
13 changes: 11 additions & 2 deletions crates/clarirs_py/src/ast/bv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ impl BV {
Self::new_with_name(py, inner, None)
}

pub fn new_with_name(py: Python, inner: &BitVecAst<'static>, name: Option<String>) -> Result<Py<BV>, ClaripyError> {
pub fn new_with_name(
py: Python,
inner: &BitVecAst<'static>,
name: Option<String>,
) -> Result<Py<BV>, ClaripyError> {
if let Some(cache_hit) = PY_BV_CACHE.get(&inner.hash()).and_then(|cache_hit| {
cache_hit
.bind(py)
Expand Down Expand Up @@ -405,7 +409,12 @@ impl BV {
}

#[pyfunction(signature = (name, size, explicit_name = false))]
pub fn BVS(py: Python, name: String, size: u32, explicit_name: bool) -> Result<Py<BV>, ClaripyError> {
pub fn BVS(
py: Python,
name: String,
size: u32,
explicit_name: bool,
) -> Result<Py<BV>, ClaripyError> {
let name: String = if explicit_name {
name.to_string()
} else {
Expand Down
18 changes: 15 additions & 3 deletions crates/clarirs_py/src/ast/fp.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#![allow(non_snake_case)]

use std::sync::{atomic::{AtomicUsize, Ordering}, LazyLock};
use std::sync::{
atomic::{AtomicUsize, Ordering},
LazyLock,
};

use dashmap::DashMap;
use pyo3::types::{PyFrozenSet, PyWeakrefReference};
Expand Down Expand Up @@ -104,7 +107,11 @@ impl FP {
Self::new_with_name(py, inner, None)
}

pub fn new_with_name(py: Python, inner: &FloatAst<'static>, name: Option<String>) -> Result<Py<FP>, ClaripyError> {
pub fn new_with_name(
py: Python,
inner: &FloatAst<'static>,
name: Option<String>,
) -> Result<Py<FP>, ClaripyError> {
if let Some(cache_hit) = PY_FP_CACHE.get(&inner.hash()).and_then(|cache_hit| {
cache_hit
.bind(py)
Expand Down Expand Up @@ -175,7 +182,12 @@ impl FP {
}

#[pyfunction(signature = (name, sort, explicit_name = false))]
pub fn FPS(py: Python, name: &str, sort: PyFSort, explicit_name: bool) -> Result<Py<FP>, ClaripyError> {
pub fn FPS(
py: Python,
name: &str,
sort: PyFSort,
explicit_name: bool,
) -> Result<Py<FP>, ClaripyError> {
let name: String = if explicit_name {
name.to_string()
} else {
Expand Down
17 changes: 14 additions & 3 deletions crates/clarirs_py/src/ast/string.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#![allow(non_snake_case)]

use std::sync::{atomic::{AtomicUsize, Ordering}, LazyLock};
use std::sync::{
atomic::{AtomicUsize, Ordering},
LazyLock,
};

use dashmap::DashMap;
use pyo3::types::{PyFrozenSet, PyWeakrefReference};
Expand All @@ -21,7 +24,11 @@ impl PyAstString {
Self::new_with_name(py, inner, None)
}

pub fn new_with_name(py: Python, inner: &StringAst<'static>, name: Option<String>) -> Result<Py<PyAstString>, ClaripyError> {
pub fn new_with_name(
py: Python,
inner: &StringAst<'static>,
name: Option<String>,
) -> Result<Py<PyAstString>, ClaripyError> {
if let Some(cache_hit) = PY_STRING_CACHE.get(&inner.hash()).and_then(|cache_hit| {
cache_hit
.bind(py)
Expand Down Expand Up @@ -90,7 +97,11 @@ impl PyAstString {
}

#[pyfunction(signature = (name, explicit_name = false))]
pub fn StringS(py: Python, name: &str, explicit_name: bool) -> Result<Py<PyAstString>, ClaripyError> {
pub fn StringS(
py: Python,
name: &str,
explicit_name: bool,
) -> Result<Py<PyAstString>, ClaripyError> {
let name: String = if explicit_name {
name.to_string()
} else {
Expand Down

0 comments on commit 9e903ca

Please sign in to comment.