summary refs log tree commit diff
path: root/rust/src/lib.rs
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2022-09-06 22:24:46 +0100
committerErik Johnston <erik@matrix.org>2022-09-09 16:22:45 +0100
commit53e83c76b2f153f934086687c74d8bd88380674f (patch)
tree681b7e1d1ec80b9f9f5f387a60d92f8f6f1d318a /rust/src/lib.rs
parentUse an upsert for `receipts_graph`. (#13752) (diff)
downloadsynapse-53e83c76b2f153f934086687c74d8bd88380674f.tar.xz
SNAPSHOT
Diffstat (limited to 'rust/src/lib.rs')
-rw-r--r--rust/src/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/rust/src/lib.rs b/rust/src/lib.rs

index 142fc2ed93..dc01c623a9 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs
@@ -1,5 +1,7 @@ use pyo3::prelude::*; +mod lru_cache; + /// Formats the sum of two numbers as string. #[pyfunction] #[pyo3(text_signature = "(a, b, /)")] @@ -9,8 +11,9 @@ fn sum_as_string(a: usize, b: usize) -> PyResult<String> { /// The entry point for defining the Python module. #[pymodule] -fn synapse_rust(_py: Python<'_>, m: &PyModule) -> PyResult<()> { +fn synapse_rust(py: Python<'_>, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(sum_as_string, m)?)?; + lru_cache::register_module(py, m)?; Ok(()) }