Skip to content

Commit

Permalink
fix(python): remove the macro_export and use pub(crate) instead so th…
Browse files Browse the repository at this point in the history
…at it doesn't leak into the documentations.
  • Loading branch information
ghyatzo committed Sep 8, 2024
1 parent 6afa212 commit f116f27
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ffi/python/controllers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use crate::cursor::Controller as CursorController;
use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;

use super::a_sync_allow_threads;
use super::Promise;
use crate::a_sync_allow_threads;

// need to do manually since Controller is a trait implementation
#[pymethods]
Expand Down
6 changes: 3 additions & 3 deletions src/ffi/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ impl Promise {
}
}

#[macro_export]
macro_rules! a_sync {
($x:expr) => {{
Ok($crate::ffi::python::Promise(Some(
Expand All @@ -91,8 +90,8 @@ macro_rules! a_sync {
)))
}};
}
pub(crate) use a_sync;

#[macro_export]
macro_rules! a_sync_allow_threads {
($py:ident, $x:expr) => {{
$py.allow_threads(move || {
Expand All @@ -103,6 +102,7 @@ macro_rules! a_sync_allow_threads {
})
}};
}
pub(crate) use a_sync_allow_threads;

#[derive(Debug, Clone)]
struct LoggerProducer(mpsc::UnboundedSender<String>);
Expand Down Expand Up @@ -197,7 +197,7 @@ fn set_logger(py: Python, logging_cb: PyObject, debug: bool) -> bool {

impl From<crate::errors::ConnectionError> for PyErr {
fn from(value: crate::errors::ConnectionError) -> Self {
PyConnectionError::new_err(format!("Connection error: {value}"))
PyConnectionError::new_err(format!("Connection error: {value}"))
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ffi/python/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use crate::cursor::Controller as CursorController;
use crate::workspace::Workspace;
use pyo3::prelude::*;

use super::a_sync_allow_threads;
use super::Promise;
use crate::a_sync_allow_threads;

#[pymethods]
impl Workspace {
Expand Down

0 comments on commit f116f27

Please sign in to comment.