aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 213d20e..9d2c8e9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,15 +1,16 @@
use pyo3::prelude::*;
+use pyo3::wrap_pyfunction;
-/// Formats the sum of two numbers as string.
#[pyfunction]
-fn sum_as_string(a: usize, b: usize) -> PyResult<String> {
- Ok((a + b).to_string())
+fn process_rule_pack(rule_pack: &str) -> PyResult<String> {
+ // 处理规则包的逻辑
+ Ok(format!("Processed rule pack: {}", rule_pack))
}
/// A Python module implemented in Rust.
#[pymodule]
#[pyo3(name = "libcore")]
-fn corelib(_py: Python, m: &PyModule) -> PyResult<()> {
- m.add_function(wrap_pyfunction!(sum_as_string, m)?)?;
+fn libcore(_py: Python, m: &PyModule) -> PyResult<()> {
+ m.add_function(wrap_pyfunction!(process_rule_pack, m)?)?;
Ok(())
} \ No newline at end of file